fsx: Remove environment references
This commit removes the reference to the environment from the fsx package.
This commit is contained in:
parent
5a43ecfaeb
commit
3263920d6b
25 changed files with 167 additions and 183 deletions
25
pkg/fsx/dir.go
Normal file
25
pkg/fsx/dir.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package fsx
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
)
|
||||
|
||||
// DefaultDirPerm should be used by callers to use a consistent mode for new directories.
|
||||
const DefaultDirPerm fs.FileMode = fs.ModeDir | fs.ModePerm
|
||||
|
||||
// Mkdir is like [os.Mkdir].
|
||||
func Mkdir(path string, mode fs.FileMode) error {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
return os.Mkdir(path, fs.ModeDir|mode)
|
||||
}
|
||||
|
||||
// MkdirAll is like [os.MkdirAll].
|
||||
func MkdirAll(path string, mode fs.FileMode) error {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
return os.MkdirAll(path, fs.ModeDir|mode)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue