5 ms·
This code suffers from a race condition: the file might be deleted/moved/renamed at any point, even if the file.is_open() check succeeds. Code that does not con
by Aeolos 10y ago
This code suffers from a race condition: the file might be deleted/moved/renamed at any point, even if the file.is_open() check succeeds. Code that does not consider this possibility is technically fragile under a wide set of pretty common conditions.
- prodigal_erik 10y agoWindows doesn't allow deleting an open file. Unix allows the deleted file to be used (even for IPC) and doesn't GC it until it's closed. Breaking an open file's user would be bad design requiring some kind of complicated notification system to be at all usable.