-
manage hdd liike ram?
I was curious, there's a program called "ZDelete" out there that doesn't just "delete" something from your hard drive, it physically removes it. I was wondering if that might be possible to do in C.
What do you do in order to do that? Does it kinda work like ram, where you can manually set certain addresses to a value, and just find the beginning and end of the program and set all value's in between to NULL or something?
I was just curious, and it might make for some nice extra-credit work for me :)
-
It just writes over the data with "a character, its complement, then a random character" to make sure that it has no remains physically, not just software wise. This could be easily implemented in c.
-
OK, how could I do that? I only have a college semester's training in C, nothing special.... :s
-
It is an OS specific operation. Tell us the OS we will tell you how, but bear in mind this is one of those "oh crap this is over my head" moments for you in all probability.
-
1) Get the size of the file.
2) Open the file for writing.
3) While not at the end of the file, a random byte.
4) Rewind the file.
5) While you're still having fun, go to step 3.
6) Close the file.
7) Delete the file.
Quzah.
-
Actually Quzah is right. So long as you keep the file the same size there is 0 chance of the file being moved to a different location on the HDD. Good one Quzah.
-
Thanx quzah, shudda thought of that.... That'll work nicely....
Since this won't always be on a Windows machine, is there a way, without addressing the system, to delete the file?
-
-
Thanx :)
OK, I have everything I need and I've writting the program, I think overwriting it 3, maybe 4, time should be enough....?