Join Nostr
2024-05-25 19:45:13 UTC

Greg Wilson on Nostr: Using Python 3.11 or higher, I want to create an output file *and* add a line ...

Using Python 3.11 or higher, I want to create an output file *and* add a line describing it to a log file as an atomic operation: either the output file is created and the log entry is added, or neither happens. fcntl.flock() is only advisory - will something else give me stronger guarantees, preferably on all three major OSes? #python #file-lock #atomic-operation #question