4 ms·
POSIX does not work this way. When the last directory entry for a file is passed to the unlink() system call, the file is removed from the directory hierarchy.
by chasil 4y ago
POSIX does not work this way.
When the last directory entry for a file is passed to the unlink() system call, the file is removed from the directory hierarchy.
However, the data on media will be deleted only after all open file descriptors are closed.
One exploitation of this feature that I have seen is the SQLite temporary tablespace, which is created and immediately unlinked, ensuring that it will not persist after the program terminates.
- noasaservice 4y ago> POSIX does not work this way. Yes, it does. Windows is POSIX/FIPS-151 https://www.quora.com/Is-Windows-POSIX-compliant https://www.quora.com/Is-Windows-POSIX-compliant
- chasil 4y agoIt was, but the POSIX subsystem was removed. In any case, I have never seen any way to coerce POSIX unlink() behavior on Windows. 'Broad software compatibility was initially achieved with support for several API "personalities", including Windows API, POSIX, and OS/2 APIs – the latter two were phased out starting with Windows XP.' https://en.wikipedia.org/wiki/Windows_NT https://en.wikipedia.org/wiki/Windows_NT