Subtle differences between *nix and Windows

One of them is how file removal is handled:

On Windows, attempting to remove a file that is in use causes an exception to be raised; on Unix, the directory entry is removed but the storage allocated to the file is not made available until the original file is no longer in use.

One of the reasons why Windows is famous for its reboot cycle on initial setup and configuration (also application installation). Though one can argue that it ensures less confusion on files: in *nix you can let a application access a file, delete it and create a new file with same file name which later cause confusion on why the file isn’t updated properly – you simply can’t do that in Windows. Also if you can delete a file in Windows, then the file is deleted. This is unlike in *nix which if an application still accessing the deleted file, it can be recovered by accessing its file descriptor. Additionally, the space is not freed after deletion, only after all applications accessing the file released the file descriptor or closed – I know some people are confused why the free space doesn’t increase after deleting some files.

Leave a Reply

Your email address will not be published. Required fields are marked *