perms

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: BSD-3-Clause Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ReadOnly         = 0o400
	ReadWrite        = 0o640
	ReadWriteExecute = 0o750
)

Variables

This section is empty.

Functions

func ChmodR

func ChmodR(dir string, dirOnly bool, perm os.FileMode) error

ChmodR sets the permissions of all directories and optionally files to [perm] permissions.

func Create

func Create(filename string, perm os.FileMode) (*os.File, error)

Create a file at [filename] that has [perm] permissions.

func WriteFile

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

WriteFile writes [data] to [filename] and ensures that [filename] has [perm] permissions. Will write atomically on linux/macos and fall back to non-atomic ioutil.WriteFile on windows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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