Reputation: 1521
I understand os.unlink() is like os.remove() in python as pointed out here. My question is: does it actually remove the file itself? My guess is not. Can I then undo this action?
Upvotes: 0
Views: 805
Reputation: 473
Unlink / remove and more other functions that delete file usually delete only the file system information not the content itself. This is done for performance considerations. But that means that the space occupied by the content is free to be written over, so if you want to recover try and don't write too much to that partition (if it's a HDD) or the disk itself (if it's a SSD or flash based storage)/
That the way the recovery programs are able to recover a lot of files. Depending of the file system (if it journaled aka saves what operations have been made) you can recover more or less information about the file.
In some cases (special programs / settings or other situations i might not think about now) the content is written over for security pourpuses.
Upvotes: 1