Documentation
¶
Index ¶
- func AtomicSave(dest string, src io.Reader, mode os.FileMode) error
- func AtomicSaveBytes(dest string, content []byte, mode os.FileMode) error
- func AtomicSaveDirWith(dest string, mode os.FileMode, handler func(tempDir string) error) error
- func AtomicSaveFromFile(dest string, handler func(tempFileName string) error) error
- func AtomicSaveString(dest string, content string, mode os.FileMode) error
- func AtomicSaveWith(dest string, mode os.FileMode, handler func(dest io.Writer) error) error
- func Exists(file string) (bool, error)
- func RemoveIfExists(filename string) error
- func SymlinkIfNot(oldname string, newname string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicSave ¶
AtomicSave saves src to the file making sure that the file saving is all-or-nothing.
func AtomicSaveBytes ¶
AtomicSaveBytes is AtomicSave(bytes.NewReader(content))
func AtomicSaveDirWith ¶
AtomicSaveDirWith atomically saves contents written to tempDir
func AtomicSaveFromFile ¶
AtomicSaveFromFile atomically saves the file written to tempFile to dest
func AtomicSaveString ¶
AtomicSaveString is AtomicSave(strings.NewReader(content))
func AtomicSaveWith ¶
AtomicSaveWith atomically saves content written to dest
func RemoveIfExists ¶
RemoveIfExists removes the given file, reporting success if the file does not exist.
func SymlinkIfNot ¶
SymlinkIfNot creates a symlink at newname pointing to oldname.
It returns success if newname is already a symlink pointing to oldname, and error on any other kind of error.
Types ¶
This section is empty.