diff --git a/.gitignore b/.gitignore index 58aa97d..a35a883 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ tmp myapp* example/docker +.idea diff --git a/sys_posix.go b/sys_posix.go index 0c0a56f..a43fbfd 100644 --- a/sys_posix.go +++ b/sys_posix.go @@ -26,9 +26,18 @@ func move(dst, src string) error { return nil } //HACK: we're shelling out to mv because linux - //throws errors when crossing device boundaryes. + //throws errors when crossing device boundaries. //TODO see sys_posix_mv.go - return exec.Command("mv", src, dst).Run() + if err := exec.Command("mv", src, dst).Run(); err != nil { + return err + } + + // Run sync to 'commit' the mv by clearing caches + return sync().Run() +} + +func sync() *exec.Cmd { + return exec.Command("sync") } func chmod(f *os.File, perms os.FileMode) error {