fsutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: CC0-1.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fsutil provides durable file writes and private filesystem permissions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPrivate

func CheckPrivate(path string) error

CheckPrivate requires a regular, non-symlink file owned by the effective UID, with no permissions granted to its group or other users.

func EnsureDir0700

func EnsureDir0700(path string) (err error)

EnsureDir0700 creates path and missing parents with mode 0700, or tightens an existing directory owned by the effective UID to that mode. Symlinks are refused.

func FsyncDir

func FsyncDir(dir string) error

FsyncDir syncs the directory's entries to stable storage.

func SetUmask

func SetUmask(mask int) int

SetUmask sets the process-wide file creation mask and returns the old mask. Callers must serialize changes with all file creation in the process.

func WriteFileAtomic

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

WriteFileAtomic replaces path with data using a temporary file in the same directory, syncing the file before rename and the directory afterwards.

Types

This section is empty.

Jump to

Keyboard shortcuts

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