fileutil

package
v0.1.143 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOOSWindows = "windows"
)

Variables

This section is empty.

Functions

func ArchiveDir added in v0.1.117

func ArchiveDir(dir, out string, excludes []string) error

func ChownRToUser added in v0.1.53

func ChownRToUser(path string) error

func ChownToUser added in v0.1.53

func ChownToUser(path string) error

func CopyDir added in v0.1.58

func CopyDir(src, dst string, filter func(path string, entry fs.DirEntry) bool) error

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist.

func CopyFileContents added in v0.1.58

func CopyFileContents(source, dest string, perm fs.FileMode) error

CopyFileContents that copies file contents and does Chown when needed to drop sudo privileges.

func FindMatchingBaseDir

func FindMatchingBaseDir(path string, matching []string, stopDir string) string

func FindSubdirsOfMatching

func FindSubdirsOfMatching(path string, matching []string) []string

func FindYAML

func FindYAML(path string) string

func FindYAMLFiles

func FindYAMLFiles(path string, match func(string) bool) []string

func FindYAMLFilesByName added in v0.1.113

func FindYAMLFilesByName(path string, name ...string) []string

func FindYAMLGoingUp

func FindYAMLGoingUp(path, name string) string

func GetModTimeFromFile added in v0.1.67

func GetModTimeFromFile(path string) time.Time

func IsRelativeSubdir added in v0.1.11

func IsRelativeSubdir(parent, dir string) bool
func IsSymlink(path string) (bool, error)

IsSymlink determines if the given path is a symbolic link.

func LchownRToUser added in v0.1.53

func LchownRToUser(path string) error

func LchownToUser added in v0.1.53

func LchownToUser(path string) error

func Mkdir added in v0.1.53

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

Mkdir that does Chown when needed to drop sudo privileges.

func MkdirAll added in v0.1.53

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

MkdirAll that does Chown when needed to drop sudo privileges.

func Symlink(oldname, newname string) error

Symlink that does Chown when needed to drop sudo privileges.

func Touch added in v0.1.67

func Touch(path string) error

func WriteFile added in v0.1.53

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

WriteFile that does Chown when needed to drop sudo privileges.

func YAMLError

func YAMLError(path, msg string, data []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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