51eeae3640
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>
10 lines
283 B
Go
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)
|
|
}
|