Recovering deleted file on windows [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
开发者_如何学C Improve this questionI 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!!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:
- Direct Drive Access
- Create File
- 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.
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.
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.
精彩评论