Click to See Complete Forum and Search --> : Delete a file


NonstopChachacha
June 1st, 2009, 10:26 PM
I have to create a file but after the application closes, it must also be deleted
I have to run and test the application again and again many times that my trashbin gets larger in size with this...trash :(.
Is there an api or a way to delete the file without sending it into the trashbin ? ?
Thanks

skval
June 2nd, 2009, 03:56 PM
DeleteFile()

NonstopChachacha
June 2nd, 2009, 09:48 PM
Yes thankyou, that function and shFileExecute can do this but except those, there aren't any way else to make the file disapear forever. By forever I mean it will be unable to be brought back. I don't like the hafl-life method, one is to hit and another is to soothe. One shoot one life!

MrViggy
June 3rd, 2009, 03:44 PM
As far as I know, DeleteFile (http://msdn.microsoft.com/en-us/library/aa363915(VS.85).aspx) does not move the file to the trash bin. It deletes it immediately (or when all handles to the file are closed).

Viggy

NonstopChachacha
June 3rd, 2009, 08:48 PM
Around and around I still read the same information :(

Chris_F
June 7th, 2009, 01:29 AM
I still don't think we grasp your problem. Maybe if you explain yourself better.

DeleteFile() does not move it trash. It removes the file from the file table(ie. same as Shift+Delete would in windows explorer.)

If this isn't enough, and you need it to be deleted in a way in which undelete/data recovory programs cannot restore it, then simply open the file for writing to it, then for every byte in the file write a 0x00 and then follow up with a DeleteFile(). This way the file is removed from the table and the physical data has been overwritten.

wigga
June 8th, 2009, 07:44 AM
To expand on what chris said.
The file may still be recoverable by reading the magnetic history.
The file may be overwritten in diffrent bit settings more than once.

http://www.fileshredderpro.com/shredding-algorithms.html

kudos please.


Take a note tho. Doing this in SD cards is pointless and destroys the SD card!