Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrSymlinkTarget = errors.New("refusing to replace a symlink target")
)
Functions ¶
func AtomicReplaceFile ¶
AtomicReplaceFile atomically replaces targetPath with tempPath. tempPath and targetPath must be on the same filesystem.
func AtomicReplaceFileNoSymlink ¶ added in v0.28.0
AtomicReplaceFileNoSymlink atomically replaces targetPath, but refuses a symlink that was present when the commit was attempted. The check is paired with rename: rename never follows the final target symlink, so a race cannot redirect the staged bytes outside targetPath.
func AtomicWriteNewFile ¶ added in v0.23.1
AtomicWriteNewFile atomically installs tempPath at targetPath only if targetPath does not already exist. tempPath and targetPath must be on the same filesystem.
Types ¶
type CommittedError ¶ added in v0.28.0
type CommittedError struct {
Err error
}
CommittedError reports a cleanup error after the destination was already installed. Callers must not report the operation as an uncommitted write.
func (*CommittedError) Error ¶ added in v0.28.0
func (e *CommittedError) Error() string
func (*CommittedError) Unwrap ¶ added in v0.28.0
func (e *CommittedError) Unwrap() error