package writefile
Import Path
go.pact.im/x/plumb/internal/writefile (on go.dev)
Dependency Relation
imports 2 packages, and imported by 2 packages
Involved Source Files
Package writefile writes a file atomically, so an interrupted or failed write
cannot leave a truncated file where a previous good one was.
Package-Level Functions (only one, which is exported)
Write atomically writes data to name with mode 0o644. It writes to a temp file
in name's own directory and renames it over name: an interrupted write cannot
leave a partial file in place of the previous good one, and sharing the
directory keeps the rename a same-filesystem swap. The parent directory must
already exist (os.CreateTemp fails when it does not, so Write never creates
it), and a failed write removes the temp file rather than leaving it behind.
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64)