News for hackers. Stuff that matters.
Re:Windows is the strangest, or hardest, operating system to... by trelane on Wednesday November 30, 2022 @11:06AM (#33802709)
The "location on disk" (blocks) are owned by the file until all descriptors to it are closed. So nothing else can write to those blocks (actually, inodes) until all file handles to it are closed. At that point, the inodes in the file will be freed to be reclaimed by another file.
Re:Windows is the strangest, or hardest, operating system to... by trelane on Wednesday November 30, 2022 @11:13AM (#33802842)
This is actually really handy behavior to have in a number of cases. A prominent example is temp files. They will automatically be cleaned up on process exit by the filesystem if you open and then delete them. It also helps prevent (not completely, but greatly reduces the window) others from accessing the temp file. you can also use this for intermediate files. Process A creates and writes, B opens for read and immediately deletes the file. A can continue writing and B continue reading until both close their file descriptor, at which point the inodes will get freed.
Re:Windows is the strangest, or hardest, operating system to... by phendrenad2 on Wednesday November 30, 2022 @10:31PM (#33812000)
That doesn't answer my question. I'm saying that you can't recover the file in any realistic way, in a reliable way. Once you close the file descriptor, the file is gone.