fileio

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExecutablePerms are Linux permissions (rwxr--r--) for executable files (scripts, binaries, etc.)
	ExecutablePerms = os.FileMode(0o744)
	// NonExecutablePerms are Linux permissions (rw-r--r--) for non-executable files (configs, RPMs, etc.)
	NonExecutablePerms = os.FileMode(0o644)
)

Functions

func CopyFile

func CopyFile(src string, dest string, perms os.FileMode) error

func CopyFileN

func CopyFileN(src io.Reader, dest string, perms os.FileMode, n int64) error

func CopyFiles

func CopyFiles(src, dest, ext string, copySubDir bool, overridePerms *os.FileMode) error

CopyFiles copies files from src to dest.

If 'ext' is non-empty, copies only files with the specified extension, otherwise copies all files.

If `copySubDir` is set to false, copies files only from 'src' directory and does not iterate over sub-directories.

If `copySubDir` is set to true, iterates through all sub-directories and copies the directory tree along with all the files.

If `copySubDir` is used with 'ext', iterates through all sub-directories and only copies files with the specified extension.

func FileExists added in v1.1.0

func FileExists(filePath string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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