Documentation
¶
Overview ¶
Package fsutil holds small filesystem helpers shared across commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistingPerm ¶
ExistingPerm returns path's permission bits, or def when it cannot be stat'd. Use with WriteAtomic to keep an existing file's mode.
func OpenJSONL ¶
OpenJSONL replays the append-only log at path line by line into replay, then returns it open for appending. A torn trailing line (crash mid-write) is handed to replay like any other (callers skip lines that don't decode) and then terminated with '\n', so the next record starts on its own line instead of being glued onto — and lost with — the torn one.
func RestrictToOwner ¶
RestrictToOwner is a no-op here: the 0600 mode the caller creates files with already is owner-only. (Windows replaces the DACL.)
func VerifyPrivate ¶
VerifyPrivate reports whether group and other have no access to path.
func WriteAtomic ¶
WriteAtomic writes data to path so a reader sees either the old or the new content, never a partial file: temp file in the same directory, fsync, chmod perm, rename, fsync the directory. The directory must exist.
Types ¶
This section is empty.