Truezip umout()失败,“无法删除临时文件”

时间:2012-08-14 07:05:57

标签: truezip

有人知道,为什么会发生这种情况?调用File.unmount()时发生错误:

de.schlichtherle.truezip.fs.FsSyncException: part:file:/C:/Data/Backup/New%20Backups/F20120805T070000Z.part!/
    at de.schlichtherle.truezip.fs.archive.FsTargetArchiveController.close(FsTargetArchiveController.java:623)
    at de.schlichtherle.truezip.fs.archive.FsTargetArchiveController.sync0(FsTargetArchiveController.java:472)
    at de.schlichtherle.truezip.fs.archive.FsTargetArchiveController.sync(FsTargetArchiveController.java:460)
    at de.schlichtherle.truezip.fs.archive.FsContextController.sync(FsContextController.java:236)
    at de.schlichtherle.truezip.fs.FsResourceController.sync(FsResourceController.java:84)
    at de.schlichtherle.truezip.fs.FsCacheController.sync(FsCacheController.java:220)
    at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:148)
    at de.schlichtherle.truezip.fs.FsLockController$1Sync.call(FsLockController.java:381)
    at de.schlichtherle.truezip.fs.FsLockController$1Sync.call(FsLockController.java:370)
    at de.schlichtherle.truezip.fs.FsLockController.locked(FsLockController.java:166)
    at de.schlichtherle.truezip.fs.FsLockController.writeLocked(FsLockController.java:108)
    at de.schlichtherle.truezip.fs.FsLockController.sync(FsLockController.java:394)
    at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:148)
    at de.schlichtherle.truezip.fs.archive.zip.KeyManagerController.sync(KeyManagerController.java:125)
    at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:148)
    at de.schlichtherle.truezip.fs.FsFalsePositiveController.sync(FsFalsePositiveController.java:516)
    at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:139)
    at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:100)
    at de.schlichtherle.truezip.file.TVFS.sync(TVFS.java:284)
    at de.schlichtherle.truezip.file.TVFS.sync(TVFS.java:231)
    at de.schlichtherle.truezip.file.TFile.sync(TFile.java:949)
    at de.schlichtherle.truezip.file.TFile.umount(TFile.java:997)
.
.
.
Caused by: java.io.IOException: C:\Data\Backup\New Backups\F20120805T070000Z.part.8228029877339677208.tmp (cannot delete temporary file)
    at de.schlichtherle.truezip.fs.file.TempFilePool$Buffer.pool(TempFilePool.java:80)
    at de.schlichtherle.truezip.fs.file.TempFilePool$Buffer.release(TempFilePool.java:70)
    at de.schlichtherle.truezip.fs.file.FileOutputSocket.release(FileOutputSocket.java:126)
    at de.schlichtherle.truezip.fs.file.FileOutputSocket.close(FileOutputSocket.java:97)
    at de.schlichtherle.truezip.fs.file.FileOutputSocket.access$100(FileOutputSocket.java:28)
    at de.schlichtherle.truezip.fs.file.FileOutputSocket$1OutputStream.close(FileOutputSocket.java:153)
    at de.schlichtherle.truezip.io.DecoratingOutputStream.close(DecoratingOutputStream.java:65)
    at de.schlichtherle.truezip.zip.RawZipOutputStream.close(RawZipOutputStream.java:696)
    at de.schlichtherle.truezip.fs.archive.zip.ZipOutputShop.close(ZipOutputShop.java:250)
    at de.schlichtherle.truezip.fs.archive.FsMultiplexedOutputShop.close(FsMultiplexedOutputShop.java:169)
    at de.schlichtherle.truezip.socket.DisconnectingOutputShop.close(DisconnectingOutputShop.java:107)
    at de.schlichtherle.truezip.socket.LockOutputShop.close(LockOutputShop.java:68)
    at de.schlichtherle.truezip.fs.archive.FsTargetArchiveController.close(FsTargetArchiveController.java:618)
    ... 26 more

我知道这是由于tmp文件无法删除。但为什么会这样呢?

1 个答案:

答案 0 :(得分:0)

您是否可能同时观察目录,例如在Windows资源管理器?某些Explorer扩展访问文件以进行检查。如果同时发生这种情况,则JVM无法删除临时文件,因为Windows不允许这样做。

我可以告诉你正在运行Java 6.如果你切换到Java 7,那么你应该得到一个更详细的例外,这可能有助于检查我的假设。