MCPcopy
hub / github.com/docker/docker-agent / syncDir

Function syncDir

pkg/cache/cache.go:372–379  ·  view source on GitHub ↗

syncDir best-effort fsyncs a directory so a recent rename inside it is persisted. Directory fsync is not portable (e.g. unsupported on Windows); a failure here does not invalidate the data.

(dir string)

Source from the content-addressed store, hash-verified

370// persisted. Directory fsync is not portable (e.g. unsupported on
371// Windows); a failure here does not invalidate the data.
372func syncDir(dir string) {
373 d, err := os.Open(dir)
374 if err != nil {
375 return
376 }
377 defer d.Close()
378 _ = d.Sync()
379}

Callers 1

writeJSONFunction · 0.85

Calls 2

OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected