fsutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chown

func Chown(path string, owner *OwnerConfig)

Chown sets ownership if owner is not nil. Best-effort, ignores errors.

func Create

func Create(path string, owner *OwnerConfig) (*os.File, error)

Create creates file and sets ownership.

func MkdirAll

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

MkdirAll creates directory and sets ownership on all newly created directories, not just the leaf. This ensures intermediate directories are also chowned when the path contains multiple new segments.

func WriteFile

func WriteFile(path string, data []byte, perm os.FileMode, owner *OwnerConfig) error

WriteFile writes file and sets ownership.

Types

type OwnerConfig

type OwnerConfig struct {
	UID int
	GID int
}

OwnerConfig holds parsed UID/GID for file ownership.

func ParseOwner

func ParseOwner(owner string) (*OwnerConfig, error)

ParseOwner parses "UID:GID" string. Returns nil if empty.

Jump to

Keyboard shortcuts

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