MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / _unlock_file

Function _unlock_file

core/database.py:57–65  ·  view source on GitHub ↗
(file_obj: IO[str])

Source from the content-addressed store, hash-verified

55
56
57def _unlock_file(file_obj: IO[str]) -> None:
58 if os.name == "nt":
59 import msvcrt
60
61 msvcrt.locking(file_obj.fileno(), msvcrt.LK_UNLCK, 1)
62 else:
63 import fcntl
64
65 fcntl.flock(file_obj.fileno(), fcntl.LOCK_UN)
66
67
68@asynccontextmanager

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected