MCPcopy
hub / github.com/rclone/rclone / Sync

Method Sync

vfs/read_write.go:416–429  ·  view source on GitHub ↗

Sync commits the current contents of the file to stable storage. Typically, this means flushing the file system's in-memory copy of recently written data to disk.

()

Source from the content-addressed store, hash-verified

414// this means flushing the file system's in-memory copy of recently written
415// data to disk.
416func (fh *RWFileHandle) Sync() error {
417 fh.mu.Lock()
418 defer fh.mu.Unlock()
419 if fh.closed {
420 return ECLOSED
421 }
422 if !fh.opened {
423 return nil
424 }
425 if fh.readOnly() {
426 return nil
427 }
428 return fh.item.Sync()
429}
430
431func (fh *RWFileHandle) logPrefix() string {
432 return fmt.Sprintf("%s(%p)", fh.file.Path(), fh)

Callers

nothing calls this directly

Calls 4

readOnlyMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
SyncMethod · 0.65

Tested by

no test coverage detected