Documentation
¶
Overview ¶
Package fsutil provides small filesystem helpers shared across glasp's internal packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteFileAtomic ¶
WriteFileAtomic writes data to path by writing to a temporary file in the same directory and renaming it into place, so a concurrent reader (or a process killed mid-write) never observes a partially written file. perm is applied to the temporary file before the rename so the final file has the requested permissions from the moment it becomes visible at path.
The destination is replaced by a single rename, so it is never observed missing: a concurrent reader sees either the old content or the new one. The rename does not follow a symlink at path onto another location — if path is a symlink, the rename replaces the symlink itself, not the file it points at (os.Rename never follows symlinks).
Types ¶
This section is empty.