fsutil

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package fsutil holds small filesystem helpers shared across the compiler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFileAtomic

func WriteFileAtomic(path string, data []byte, perm os.FileMode) error

WriteFileAtomic writes data to a temporary file in the same directory as path and then renames it over path. Because os.Rename within a directory is atomic on POSIX (and replaces the destination on Windows via MoveFileEx), a concurrent reader — e.g. the dev server serving dist/styles.css or index.html — never observes the truncate-then-write window that os.WriteFile exposes. The parent directory must already exist (callers create it).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL