]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm-remote/sync/files.go
remote: add ainsl sub-command ("append if no such line")
[safcm/safcm.git] / cmd / safcm-remote / sync / files.go
index 6e001a8186d14675864b4d90794d77694269cee0..3e3c7ec18357e8a01e21e22906e6a5e79cb8257f 100644 (file)
@@ -376,7 +376,7 @@ reopen:
                os.Remove(tmpPath)
                return err
        }
-       err = syncPath(dir)
+       err = SyncPath(dir)
        if err != nil {
                return err
        }
@@ -517,7 +517,7 @@ func WriteTemp(dir, base string, data []byte, uid, gid int, mode fs.FileMode) (
        return tmpPath, nil
 }
 
-// syncPath syncs path, which should be a directory. To guarantee durability
+// SyncPath syncs path, which should be a directory. To guarantee durability
 // it must be called on a parent directory after adding, renaming or removing
 // files therein.
 //
@@ -525,7 +525,7 @@ func WriteTemp(dir, base string, data []byte, uid, gid int, mode fs.FileMode) (
 // fsync: "Calling fsync() does not necessarily ensure that the entry in the
 // directory containing the file has also reached disk. For that an explicit
 // fsync() on a file descriptor for the directory is also needed."
-func syncPath(path string) error {
+func SyncPath(path string) error {
        x, err := os.Open(path)
        if err != nil {
                return err