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