file

package
v0.40.2-geaaru Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

func DeepCopyFile

func DeepCopyFile(src, dst string) (err error)

DeepCopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func DirectoryIsEmpty

func DirectoryIsEmpty(dir string) (bool, error)

DirectoryIsEmpty Checks wether the directory is empty or not

func EnsureDir

func EnsureDir(fileName string) error

func EnsureDirPerm

func EnsureDirPerm(src, dst string)

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func ExistsLink(name string) bool

func IsDirectory

func IsDirectory(path string) (bool, error)

func ListDir

func ListDir(dir string) ([]string, error)

func Move

func Move(src, dst string) error

func OrderFiles

func OrderFiles(target string, files []string) ([]string, []string, []string)

func RandStringRunes

func RandStringRunes(n int) string

func Read

func Read(file string) (string, error)

func Rel2Abs

func Rel2Abs(s string) (string, error)

func Sha256Sum

func Sha256Sum(path string) (string, error)

func Touch

func Touch(f string) error

Touch creates an empty file

Types

This section is empty.

Jump to

Keyboard shortcuts

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