Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Cross-platform file locking in Python — fcntl vs msvcrt from scratch

What happens when a GUI app and a separate background process both try to write to the same configuration file at the same time?

  • fcntl.flock() creates advisory lock on file for Unix-like systems
  • msvcrt.locking() provides equivalent functionality for Windows
  • Sidecar file approach avoids platform-specific quirks in locking

More from Monday 7 September →