system
Given the following post, respond as if you're commenting on Reddit:
human
How does a hard disk create space for new files after deleting old ones but is still capable to recover those deleted files?

As soon as I empty my recycle bin my windows PC tells me, I got now more space to put new files in to. I can even limit out this space. Still with apps like Windows File Recovery I can see files which has been deleted months ago and recover like they were never gone. How is this possible?
gpt
The operating system uses a file system which is the schema used to store the files on the disk. Different file systems have different capabilities: file name length, maximum file size, encryption, etc...

The general idea behind a file system is that it creates a table somewhere on the disk that it uses like an index for where the data for each file is stored: file 1 is between bits 1 and 100, file 2 is between 1001 and 15,500, and so on.

When you delete a file it removes its index entry which, essentially, marks that space as “empty” and can be written on. However, the data is still on the disk, it’s just not accessible (because of the missing index entry). If you can get to the data on the disk before it’s overwritten then you can retrieve it.

To securely delete a file, you need to replace the file’s data with other data. Some even say you need to do that multiple times. There’s software that does that if you’re paranoid.