The original email stated that he was opening the existing file in
read/write mode and writing a random character to the entire length of the
file, then closing the file and deleting it.  This will not create a new
file on the disk.

Ross.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Cosmin Prund
Sent: Wednesday, 14 November 2007 9:16 p.m.
To: Borland's Delphi Discussion List
Subject: RE: Deleting - and shredding - a file

> Behalf Of Sid Gudes wrote:
> Subject: Re: Deleting - and shredding - a file
> To: Borland's Delphi Discussion List
> 
> I don't know if tMemoryStream.SaveToFile will overwrite the existing
> file (should be OK) or create a new file and rename the old one (not
> OK).  

It overwrites the file (it actually tells the OS to overwrite the file).
There's no guarantee that the OS will write the file to disk using
exactly the same sectors on disk, so there's a chance this overwritten
file will not overlap the old file 100% percent. I noticed this behavior
while trying to recover lost files using a direct disk access technique:
I *always* find more than one copy of the file on disk, but I never
copied the file from one place to the other (so there should only be one
copy). 
ailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to