I don’t want to use Win32 API. Instead, I want to use c/c++ libraries ( I want to develop a similar tool for unix and windows environment).
Ok, but that’s not an option. And uh, there is no language known as C/C++. I know it seems a bit picky to complain about that, but there’s a good reason for saying so. They are separate languages, with C++ having significant additions to its libraries. You might as well as say I want to use C++/Java. Well, pick a language already and tell us what you are using.
C++ libraries aren’t designed to be an all encompassing platform. Instead, they provide a small core and everything else is offloaded to 3rd party libraries. You will need 3rd party function for what you have to do.
The idea in recovering deleted files can be broken down into the following essence. When you delete a file, effectively the OS sets a mark in the filesystem that says the storage area for the entire file is deleted or is free to use. It’s like taking a paper and stamping the word “shredded” on a corner of it. That’s great, but the paper can still be read. And that’s precisely what file recovery programs do. They walk through the file system, reading files despite the marks.
Such programs are very low system level programs. Concepts like “creating a file”, “opening” it, and “deleting” it are actually quite high level. The OS has to manage the hardware, the filesystem, and do a number of operations to manage whatever is considered to be “files”. You’re not just dipping into OS specific code. You’re jumping into very, very low level OS code.
I get the feeling you aren’t aware of the enormity of the task you want to undertake. For one thing, give me a brief description of the various filesystems you can encounter under windows and *NIX environments. Do you understand how they work? What does a deletion operation under those filesystems mean?