Where do files deleted via apache.commons.io.FileUtils deleteDirectory go?

huangapple go评论72阅读模式
英文:

Where do files deleted via apache.commons.io.FileUtils deleteDirectory go?

问题

我猜这可能不是那么重要,但我不知道文件是如何被删除的。它们只是突然消失了。它们不在回收站中。

我查看了Apache Common IO的文档,除了文件已被删除之外,找不到有关文件/目录如何被删除的任何信息。任何帮助都将不胜感激!

英文:

I suppose its not that important, however I have no idea how the files get deleted. They simply cease to exist. They're not in the recycle bin.

I looked in Apache Common IO's documentation and couldn't find anything about how the file/directory is deleted other than that the file is deleted. Any help would be appreciated!

答案1

得分: 2

The FileUtils.delete() and FileUtils.deleteDirectory() methods call into the java.io.FileSystem class, which is backed by native code. This essentially means that the delete() method delegates the actual deletion to the underlying OS and, consequently, to the file system on your drive.

Recycle bin is usually a GUI feature, it has nothing to do with the file system. On the file system level, there's no such thing as a "recycle bin" - the files are usually deleted with very limited ability to recover them. You can of course use some utilities to try and recover such file, however, this heavily depends on the file system you use.

英文:

The FileUtils.delete() and FileUtils.deleteDirectory() methods call into the java.io.FileSystem class, which is backed by native code. This essentially means that the delete() method delegates the actual deletion to the underlying OS and, consequently, to the file system on your drive.

Recycle bin is usually a GUI feature, it has nothing to do with the file system. On the file system level, there's no such thing as a "recycle bin" - the files are usually deleted with very limited ability to recover them. You can of course use some utilities to try and recover such file, however, this heavily depends on the file system you use.

huangapple
  • 本文由 发表于 2020年7月21日 22:10:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/63016451.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定