frostfs-node/pkg/util/os.go
Pavel Karpy 51eeae3640 [#727] util: Add MkdirAllX func
Add `MkdirAllX` function that wraps `os.MkdirAll`
and adds `x` permission for user and group.
This is used to make all created dirs openable
for user and group regardless of the read config
permissions.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-30 16:42:22 +03:00

10 lines
283 B
Go

package util
import "os"
// MkdirAllX calls os.MkdirAll with passed permissions
// but with +x for user and group. This makes created
// dir openable regardless of the passed permissions.
func MkdirAllX(path string, perm os.FileMode) error {
return os.MkdirAll(path, perm|0110)
}