一个人如何读取/恢复已删除的文件 [英] How can one read/recover deleted files

查看:47
本文介绍了一个人如何读取/恢复已删除的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要指出以下几点:

如何用Java代码读取/恢复已删除的文件.我以前用过 对于文件读写操作,来自java.io的小节,例如 FileInputStream,FileReader等,但这显然不会 工作

How can one read/recover deleted files, in Java code. I've used before for file read&write operations, clases from java.io, such as FileInputStream, FileReader, etc., but that's obviously not going to work

所以任何人,一些观点,理论,也许是一个链接...都必须有一种方法!

So anyone, some points, theory, maybe a link... there has to be a way!

推荐答案

请注意,在某些操作系统上,几乎不可能恢复已删除的文件.

Be aware that on some OS it is nearly impossible to restore a deleted file.

在谈论Windows文件系统时,然后使用一些JNI代码,您可以访问文件系统并重置删除标志.

When you talking about Windows filesystems, then with some JNI code you may access the filesystem and reset the delete flag.

很明显,如果是您的程序删除文件,则可以将它们移到bin文件夹中,如果需要,可以从该文件夹中还原.

Obviously if it is your program that delete files, you may move them into a bin folder, from which you can restore if needed.

另一种选择是编写一些服务来监视文件系统的活动,并且可以将文件复制到bin中以供以后还原.阅读 jnotify .

Another option could be to write some service that monitors filesystem activity and may copy files into a bin for later restore. Read about jnotify.

这篇关于一个人如何读取/恢复已删除的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆