MCPcopy
hub / github.com/borgbackup/borg / sync_dir

Function sync_dir

src/borg/platform/base.py:105–119  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

103
104
105def sync_dir(path):
106 if is_win32:
107 # Opening directories is not supported on Windows.
108 # TODO: Do we need to handle this in some other way?
109 return
110 fd = os.open(str(path), os.O_RDONLY)
111 try:
112 os.fsync(fd)
113 except OSError as os_error:
114 # Some network filesystems don't support this and fail with EINVAL.
115 # Other error codes (e.g. EIO) shouldn't be silenced.
116 if os_error.errno != errno.EINVAL:
117 raise
118 finally:
119 os.close(fd)
120
121
122def safe_fadvise(fd, offset, len, advice):

Callers 4

write_indexMethod · 0.85
get_write_fdMethod · 0.85
clear_empty_dirsMethod · 0.85
test_sync_dir_basicFunction · 0.85

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by 1

test_sync_dir_basicFunction · 0.68