Re: FileCopy overwrites the existing file
- From: Grzegorz Wróbel </dev/null@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Dec 2006 06:25:15 +0100
gtea wrote:
Hi,
I have a question about the use CopyFile() function from the Windows API. if the Boolean flag sets to false and new file already exists, the function overwrite the existing file and succeeds. In this case, does the contents of copied-to file (before overwriting) still exist on the hard driver somewhere and can be retrived using some type of trieval software?
Any responses would be really appreciated!
If you're lucky your new file will overwrite the disk sectors occupied by old file (if new file is of the same size or larger), but you can't make any assumption about that. It is possible as well that the new file will be stored in completely different disk sectors/clusters and the old file will be possible to recover.
Note that even if you wrote a low level utility (driver?) overwrites exactly the same the sectors as old file, it would still be possible to recover parts of that file if it has been moved earlier by for example a defragmentation program service. The usual approach to be 100% sure is to rewrite all unnocupied sectors in the hardrive (quite expensive approach).
Also be aware that simple overwriting of the file is not enough to make it unrecoverable by data recovery specializing entities. You'll need to perform multiple overwrite of such file's sectors with *random* data.
--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D
.
- Follow-Ups:
- Re: FileCopy overwrites the existing file
- From: Alexander Grigoriev
- Re: FileCopy overwrites the existing file
- Prev by Date: Re: numerically intensive app doesn't benifit from multi threading at
- Next by Date: Re: program runs almost twice as slow on 2 CPU machine when 1 CPU
- Previous by thread: Re: numerically intensive app doesn't benifit from multi threading at
- Next by thread: Re: FileCopy overwrites the existing file
- Index(es):
Relevant Pages
|