This commit is contained in:
Mechiel Lukkien
2023-01-30 14:27:06 +01:00
commit cb229cb6cf
1256 changed files with 491723 additions and 0 deletions

17
moxio/syncdir.go Normal file
View File

@ -0,0 +1,17 @@
package moxio
import (
"fmt"
"os"
)
// SyncDir opens a directory and syncs its contents to disk.
func SyncDir(dir string) error {
d, err := os.Open(dir)
if err != nil {
return fmt.Errorf("open directory: %v", err)
}
xerr := d.Sync()
d.Close()
return xerr
}