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

Method sync

src/borg/platform/base.py:193–204  ·  view source on GitHub ↗

Synchronize file contents. Everything written prior to sync() must become durable before anything written after sync().

(self)

Source from the content-addressed store, hash-verified

191 return self.f.tell()
192
193 def sync(self):
194 """
195 Synchronize file contents. Everything written prior to sync() must become durable before anything written
196 after sync().
197 """
198 from .. import platform
199
200 self.f.flush()
201 platform.fdatasync(self.fd)
202 # tell the OS that it does not need to cache what we just wrote,
203 # avoids spoiling the cache for the OS and other processes.
204 safe_fadvise(self.fd, 0, 0, "DONTNEED")
205
206 def close(self):
207 """sync() and close."""

Callers 6

closeMethod · 0.95
get_fdMethod · 0.80
readMethod · 0.80
write_commitMethod · 0.80
test_sparse_deleteFunction · 0.80
test_syncfile_syncFunction · 0.80

Calls 2

safe_fadviseFunction · 0.85
flushMethod · 0.45

Tested by 2

test_sparse_deleteFunction · 0.64
test_syncfile_syncFunction · 0.64