Post #1968503
2026-05-02 22:19 UTC
Interesting Unix race condition I hadn’t considered before: if one process is generating new files in a directory and you concurrently run rm -rf on that directory, the rm -rf can fail if it thinks the directory is empty but the rmdir at the end fails because new files have been created since
Replies (3)
-
@fay59@tech.lgbt 2026-05-02 22:40
@slava UNIX file handling receives substantially too little hate if you ask me
-
@typeswitch@gamedev.lgbt 2026-05-03 00:35
@slava filesystem is all race conditions 😢 maybe rm -rf should move the directory to a temporary / unreachable location and do the deletes there.
-
@skewray@mathstodon.xyz 2026-05-03 00:40
@slava I spent considerable time trying to think of how to 'fix' this, before I realized that the command should fail exactly as it does now.