MCPcopy Index your code
hub / github.com/VectifyAI/OpenKB / _fsync_directory

Function _fsync_directory

openkb/locks.py:183–193  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

181
182
183def _fsync_directory(path: Path) -> None:
184 if os.name == "nt":
185 # Windows cannot open a directory handle to fsync it. os.replace is
186 # atomic on NTFS (no torn/partial state), though without the dir flush
187 # the rename's durability across a crash is weaker than on POSIX.
188 return
189 fd = os.open(path, os.O_RDONLY)
190 try:
191 os.fsync(fd)
192 finally:
193 os.close(fd)
194
195
196def _default_file_mode() -> int:

Callers 3

_copy_file_atomicFunction · 0.90
_publish_staged_fileFunction · 0.90
atomic_write_bytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected