3 ms·
As others have mentioned, it was still writing to disk, but its directory entry was removed. This is considered a feature since the data will be automatically c
by jonhohle 4y ago
As others have mentioned, it was still writing to disk, but its directory entry was removed. This is considered a feature since the data will be automatically cleaned up once the process holding the last file descriptor closes it or terminates. Also as others have mentioned, Linux provides an additional directory entry through /proc, something not available on most other OSs.
In this case, you can have your cake (delete the directory entry) and eat it too (get the data back through /proc).
- phendrenad2 4y agoWhat if something else writes a file to that location on disk? Can you still have your cake?
- trelane 4y agoThe "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.
- trelane 4y agoThis 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.
- phendrenad2 4y agoThat 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.