Documentation ¶
Index ¶
- Constants
- func AtomicCopy(srcFilepath, targetDir, targetFilename string) error
- func AtomicWrite(path string, data []byte, mode os.FileMode) (err error)
- func Copy(srcFilepath, targetDir, targetFilename string) error
- func DirEquals(a, b string) (bool, error)
- func Exists(name string) bool
- func IsDirWriteable(dir string) error
Constants ¶
View Source
const (
// PrivateFileMode grants owner to read/write a file.
PrivateFileMode = 0o600
)
Variables ¶
This section is empty.
Functions ¶
func AtomicCopy ¶
Copies file by reading the file then writing atomically into the target directory
func AtomicWrite ¶
Write atomically by writing to a temporary file in the same directory then renaming
func IsDirWriteable ¶
IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable. Inspired by etcd fileutil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.