Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Symlink ¶
Symlink wraps os.Symlink, replacing an existing symlink with the same name atomically (os.Symlink fails when newname already exists, at least on Linux).
func TempDir ¶
TempDir checks whether os.TempDir() can be used as a temporary directory for later atomically replacing files within dest. If no (os.TempDir() resides on a different mount point), dest is returned.
Note that the returned value ceases to be valid once either os.TempDir() changes (e.g. on Linux, once the TMPDIR environment variable changes) or the file system is unmounted.
Types ¶
type PendingFile ¶
type PendingFile = renameio.PendingFile
PendingFile is a pending temporary file, waiting to replace the destination path in a call to CloseAtomicallyReplace.
func TempFile ¶
func TempFile(dir, path string) (*PendingFile, error)
TempFile wraps ioutil.TempFile for the use case of atomically creating or replacing the destination file at path.
If dir is the empty string, TempDir(filepath.Base(path)) is used. If you are going to write a large number of files to the same file system, store the result of TempDir(filepath.Base(path)) and pass it instead of the empty string.