Documentation ¶
Index ¶
- func CopyFileForcefully(fs afero.Fs, dst, src string, perms os.FileMode) error
- func EnsureDirExistsWithCorrectPermissions(fs afero.Fs, dir string, perms os.FileMode) error
- func FileExists(fs afero.Fs, file string) bool
- func IsEmpty(name string) (bool, error)
- func WriteNewFile(fs afero.Fs, filename string, data []byte, perms os.FileMode) error
- func WriteNewFileAtomic(fs afero.Fs, filename string, data []byte, perms os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileForcefully ¶
CopyFileForcefully copies src to dst, overwriting dst if it exists.
func EnsureDirExistsWithCorrectPermissions ¶
EnsureDirExistsWithCorrectPermissions ensures the dir exists with the correct permissions
func FileExists ¶
FileExists returns true if file exists and is a regular file, else false
func WriteNewFile ¶
WriteNewFile writes data to the file specified by filename. If the file already exists, then an error will be returned.
func WriteNewFileAtomic ¶
WriteNewFileAtomic writes data first to a temporary file (in the same directory as the desired file) and then moves it to filename. To a consumer of the file located at filename, it appears that the file was created with the given data atomically (rather than being opened/created and subsequently written to). Like WriteNewFile, this function will error out if the destination file already exists.
Types ¶
This section is empty.