Recovering deleted file on windows [closed]

微笑、不失礼 提交于 2019-11-27 19:41:04

问题


I want to write a program to recover recently deleted files on windows 7..

Is there a function in windows API that recover files? If not, how can I begin in that?

EDIT:
Or an open source project for that?

EDIT:
I do not mean Recycle Bin!!


回答1:


Well the file recovery tools all start by scanning the disk for file headers or for old traces of the file tree.

Looking to do this from scratch you need to understand your target drive and its file system. There is no API so to say, though there are projects that deal with accessing the NTFS file system directly from linux, though it sounds like you are developing in Windows. They are listed at the end of the Wiki link in my post. I have some links that will access the drive directly. From there you can t,ry to detect old files though any means you could derive from the NTFS Journal, Log or other component of the FS.

Assuming you want to use Windows 7 and will be running your program in the OS take a look these links:

  1. Direct Drive Access
  2. Create File
  3. Wikipedia Article on NTFS (The file system Windows 7 uses) Check the external links

What your looking to write is no trivial task, though that's what makes it interesting.




回答2:


Do you mean files deleted (moved to trash) or removed from the hdd (marked for replacement)? If you're looking for the second option, I'm quite sure Windows do not offer any solution to that.




回答3:


You will have to analyze the data on the disk manually, i.e. by reading the raw disk content and looking for files which are marked as deleted. A good start would be reading into the internals of the filesystem(s) you want to support since you will need them. There is no API for that.



来源:https://stackoverflow.com/questions/2837307/recovering-deleted-file-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!