Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
some one told me that when you delete file its not really destroyed

it just add something like& or $ or ~ to it like

if your file is 1.txt it will be something like ~1.txt

Is that right

What is the character added to initial file name

can I add it using ren command

how to destroy file totally

how to prevent file recovery

I need to understand what is exactly happen.
Posted

It really depends on the file system and the kind of file. One way to destroy it is to fill it with random bytes, keeping the same exact size. Moreover, as the magnetic disk have residual magnetization which can be, in principle, read below the new bits, it's better to do it several times.

The problem of "final" removal of the file is much more complex than you may think. Just for example: POSIX (which is supported by Windows NTFS as well), you can create "hard links": several files in different places of the directory tree, but pointing to the same physical unit. When you delete one, other linked files remain the same. When you delete the last of the links (none of them is "main" one, they are all equal), the file is finally removed. But the physical unit is not really wiped, a reference to it is just removed from some structure. Please see: http://en.wikipedia.org/wiki/Hard_link[^]. This is only one aspect, as related to the file system API. To dig into detail, you should learn each file system separately; and I'm not sure if you have to.

—SA
 
Share this answer
 
v2
Comments
osamaworx 31-Jan-14 20:45pm    
Thanxs ,and I appreciate your help ,but If I use NTFS what is the character used in in file name initials when deleting , or may Its not work like what I think ?
Sergey Alexandrovich Kryukov 31-Jan-14 21:10pm    
What character are you talking about? What are "file name initials"? The content of file could be anything...
—SA
Abhinav S 31-Jan-14 22:52pm    
5.
Sergey Alexandrovich Kryukov 1-Feb-14 0:50am    
Thank you, Abhinav.
—SA
PIEBALDconsult 31-Jan-14 23:17pm    
"keeping the same exact size"

I fill the final sector so the exact original size is lost.
I think the answer you are looking for depends on how the file deletion request was made and is one of the following choices:
(1) The file is moved to the recycle bin, and if you open the bin, you can peruse recently deleted files and recover most of them to their original locations in the file system. If the file system gets close to being full such that allocations fail, the system starts deleting some of these files for you. This choice is typically exercised when deleting files through Explorer, and some third party products. [This is default Explorer behavior, which can be modified.]
(2) The file's header is removed, such that it is no longer available by that name, but the information stored in that file is still out there in the file. The file's space might be reused by another file. This is the usual choice made by almost all software when deleting a file. File recovery software takes advantage of this technique when searching your disk for files accidentally deleted (that you want back). There can be different details in this for different file systems (eg. FAT, NTFS, FAT32, ext2, ...)
(3) Some file deletion products will take your file (or disk) and erase the data, writing over it sometimes several times, making sure that the information is not recoverable. This is not the default action, and this is done mostly with third party products (not typically part of the operating system). Military computers typically have this done for example. Sergey touches on this in Solution #1.
 
Share this answer
 
Comments
osamaworx 31-Jan-14 20:50pm    
Ok thanks for attention , but still quistion --> Using NTFS what Is normal actions happen when I delete file with normal windows Command ? Is it change name initials by adding specific char like ~ ? or what and if so , what is that char?
Sergey Alexandrovich Kryukov 31-Jan-14 21:11pm    
There is not such thing... And what is "normal Windows command"? They are all not too crazy... :-)
—SA
Sergey Alexandrovich Kryukov 31-Jan-14 21:17pm    
It looks like you are talking about some crazy old legacy trash called "short file names". It has nothing to do with deletion of files. Read about them, and avoid using them, ever. People using the system properly will never see such thing. If you see such names, describe what exactly you are doing, perhaps then I could tell you how to stop getting such names.
—SA
Philippe Mori 31-Jan-14 22:05pm    
In old time (FAT), the first character of a file was effectively modified when a file was deleted. See my solution.
Sergey Alexandrovich Kryukov 1-Feb-14 0:43am    
I don't remember such thing. Wasn't it something on top of normal deletion?
—SA
I don't think that the technic of modifying the first character is used anymore in recent file system. But a search on Google give me a few pages that might interest you :

http://www.easeus.com/data-recovery-ebook/file-deletion-in-FAT16.htm[^]

http://www.sirecovery.com/data-recovery-and-undelete-software-programs[^]

I don't think it was possible to undelete those file by a simple renaming as probably the system would have prevent opening of those files. So I would think that the only way to recover was to modify the directory structure in the disk sector.

As others point out, more recent system have a recycle bin and don't track files the same way. If you really want to ensure that a file is not recoverable, then the data has to be wipped out and depending on the desired security level, there are different procedures.

Also modern operating system do far more tracking on file than those older one including keeping revision or doing automatic recovery in some cases (like deleting a file from program files which the system might detect and automatically restore).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Feb-14 0:45am    
Oh gosh. I successfully skipped this trash. Thank you for the information, my 5. (I wonder where OP got all that...)
—SA
There are tools that can help you destroy files completely.
Otherwise there is a possibility that some programs might be able to recover them.

Try - 5 Tools To Permanently Delete Sensitive Data From Your Hard Drive[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Feb-14 0:46am    
Sure, a 5.
—SA
Abhinav S 1-Feb-14 0:55am    
Thank you.
"I need to understand what is exactly happen"

No, you don't.


Here's something to read: http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900