file

package
v1.0.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrivateFileMode grants owner to read/write a file.
	PrivateFileMode = 0o600
)

Variables

This section is empty.

Functions

func AtomicCopy

func AtomicCopy(srcFilepath, targetDir, targetFilename string) error

Copies file by reading the file then writing atomically into the target directory

func AtomicWrite

func AtomicWrite(path string, data []byte, mode os.FileMode) (err error)

Write atomically by writing to a temporary file in the same directory then renaming

func Copy

func Copy(srcFilepath, targetDir, targetFilename string) error

func DirEquals

func DirEquals(a, b string) (bool, error)

DirEquals check if two directories are referring to the same directory

func Exists

func Exists(name string) bool

func IsDirWriteable

func IsDirWriteable(dir string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL