set storage uid and gid.

This commit is contained in:
Miroslav Šedivý
2021-05-22 01:03:06 +02:00
parent e63c43e150
commit 51b527dace
2 changed files with 21 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package utils
import (
"os"
"path/filepath"
)
func ChownR(path string, uid, gid int) error {
return filepath.Walk(path, func(name string, info os.FileInfo, err error) error {
if err == nil {
err = os.Chown(name, uid, gid)
}
return err
})
}