Documentation
¶
Overview ¶
Package fsx holds the file operations gotools needs to keep a project safe: writes that are never half done, and a refusal to follow symlinks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lexists ¶
Lexists reports whether path exists, without following a symlink: a dangling symlink exists.
func RejectSymlink ¶
RejectSymlink returns an Environment error when path is a symlink. A path that does not exist, or cannot be inspected, passes. context names the operation in the message and may be empty.
func WriteFileAtomic ¶
WriteFileAtomic writes data to a temp file beside path and renames it over path, so a crash never leaves a half-written file. Existing contents and permissions are replaced, and perm applies to the result. The temp file is created exclusively, so a symlink planted at its name cannot redirect the write.
Types ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot remembers the content of some files so a step that may fail can put them back, or remove them if they did not exist.
func TakeSnapshot ¶
TakeSnapshot reads files now. A file that cannot be read is treated as absent.