When data gets deleted from your Recycle Bin, what happens to it?
Neither operation writes over the file.
Moving a file to the Recycle Bin does just that – moves the file, and it is the same as any other "move" operation when the new folder is on the same disk: the filename entry is moved from its original folder to another, but the file's content is still on the disk and is not physically moved, modified or even looked at.
Deleting a file from the Recycle Bin (or deleting it directly using Shift+Delete) removes the filename entry from its folder. The part of the disk previously occupied by the file is still not modified or overwritten and still contains all the file data, but that data is no longer linked to a filename. That spot of the disk is recorded as "free", however, so future writes to the disk can reuse that space, and if you keep using the disk the space will almost certainly be overwritten eventually.
In the case that you need to prevent recovery of deleted data, special tools exist to overwrite the data securely. That is not done by default because it is slow and increases wear on the disk.
A file is in two parts:
- A directory entry which records the file name and also contains a list of the blocks on disk which contain the data contents of the file. The operating system then "knows" that these blocks are in use.
- The actual blocks which contain the data contents of the file
When a file is deleted:
- The list of blocks in the directory entry are returned to the operating system marked as free. The directory entry is deleted, so the file "disappears" from the file system.
- The actual blocks are not touched, so the data contents of the file remain untouched until some other new file overwrites them. This is the reason that file recovery software can often rebuild deleted files (but only if it is used soon after deletion).
You need to clarify if you are asking what happens on the physical drive, or on the software level.
On the physical side, it depends on the drive:
On magnetic drives, overwriting bits, or writing them, is the same operation, so files usually don't get physically deleted (the operating system just changes the table of content of the partition and mark the space as free).
On SSD drives, it is not possible to write over existing data so files usually get physically deleted (See http://en.wikipedia.org/wiki/Trim_(computing) )
On the software, depends on the filesystem you are using, most of the time, only the table of content of the partition is changed.