创建垃圾文件来代替已删除的文件
我有一个奇怪的问题。当我尝试删除由我的应用程序创建的文件时,它会被删除并被文件大小完全相同的垃圾文件替换。有人可以帮我解决这个问题吗?打败了我。当我尝试手动删除文件时,也会发生同样的情况。
I have a strange problem. When I try to delete a file created by my application it gets deleted and gets replaced with a junk file of the exact same filesize. Can someone please help me out with this? Beats me. The same thing happens when I try to delete the file manually.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(除非您指定操作系统并发布一些代码,否则这纯粹是猜测。)
由于手动删除同一文件会导致相同的行为,因此可以合理地假设这不是您的代码的具体问题。
某些文件系统(例如 Linux 上的 FUSE,以及某些网络文件系统)在删除另一个进程正在使用的文件时会出现此行为。
(Unless you specify your operating system and post some of your code, this is pure guesswork.)
Since deleting the same file manually causes the same behaviour, it's reasonable to assume that this is not an issue with your code specifically.
Some filesystems (FUSE on Linux comes to mind, as well as some network filesystems) present this behaviour when deleting files that are in use by another process.
您是否在 Linux 上使用 NFS 文件系统?在某些情况下,NFS 会在已删除的文件后面留下逻辑删除。
are you perhaps using an NFS file system on linux? NFS will leave tombstones behind deleted files in some cases.