safefs

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod

func Chmod(name string, mode os.FileMode) error

Chmod changes file permissions. #nosec G302 -- update downloads must be made executable.

func Create

func Create(name string) (*os.File, error)

Create opens a file for writing with a private mode. #nosec G304 -- callers intentionally create files under user-selected directories.

func MkdirAll

func MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a directory tree with an explicit mode. #nosec G301 -- callers intentionally manage user-selected paths.

func ReadFile

func ReadFile(name string) ([]byte, error)

ReadFile reads a file from a user-selected path. #nosec G304 -- callers intentionally operate on user-selected paths.

func Remove

func Remove(name string) error

Remove deletes a file if it exists. #nosec G104 -- cleanup errors are intentionally ignored by callers.

func WriteFile

func WriteFile(name string, data []byte, perm os.FileMode) error

WriteFile writes a file with an explicit mode. #nosec G306 -- callers intentionally write to user-selected paths.

func WriteFileAtomic

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

WriteFileAtomic writes data to name atomically by writing to a temporary file in the same directory and then renaming it into place. This prevents readers from observing a partially-written file if the process is interrupted. #nosec G304 -- callers intentionally operate on user-selected paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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