Thread: SecureOverwrite
View Single Post
Old May 18th, 2006, 8:22 PM   #10
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 874
Rep Power: 4 The Dark is on a distinguished road
I think the overwrite without trunc that you are doing should be OK. Of course there is no guarentee that the OS hasn't already moved the file around previously (e.g. during a defrag), so there may be copies of the data all over the disk.

You probably don't need "fin" at all anymore, you can just use the return value of stat to check if the file exists.

I'd probably do a * every 1% of the file size, otherwise if you wipe out a 2GB file you are going to be seeing asterisks in your sleep for a week.
The Dark is offline   Reply With Quote