Skip to content

Instantly share code, notes, and snippets.

@pradeeppasupuleti
pradeeppasupuleti / flock_example.py
Created December 20, 2022 09:00 — forked from jirihnidek/flock_example.py
File locking using fcntl.flock using Python
"""
Example of using fcntl.flock for locking file. Some code inspired by filelock module.
"""
import os
import fcntl
import time
def acquire(lock_file):