files

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcPath, destPath string) error

Copy determines the type of source (file, directory, or symlink) and copies it accordingly.

func CopyDir

func CopyDir(srcDir, destDir string) error

CopyDir copies a directory from srcDir to destDir recursively.

func CopyDotFiles

func CopyDotFiles(src, dst string, logger hclog.Logger) error

CopyDotFiles copies files and directories starting with a dot from src to dst.

func CopyFile

func CopyFile(srcFile, destFile string) error

CopyFile copies a file from srcFile to destFile.

func CopySymLink(srcLink, destLink string) error

CopySymLink copies a symbolic link from srcLink to destLink.

func CreateFolderIfNotExists

func CreateFolderIfNotExists(folder string) error

CreateFolderIfNotExists checks if a folder exists, and if not, creates it.

func DetermineFileFullPath added in v0.3.0

func DetermineFileFullPath(path, nameTemplate string) (string, string, error)

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath resolves paths that include a tilde (~) to the user's home directory.

func FindByExtAndRemove

func FindByExtAndRemove(root string, exts []string)

FindByExtAndRemove walks through the directory tree rooted at root and removes files with specified extensions.

func GetValidatedFileName

func GetValidatedFileName(path string) (string, error)

GetValidatedFileName validates the given file path and returns the file name.

func ValidatePath

func ValidatePath(path string) error

ValidatePath checks if the given path is a valid file path for reading.

func WriteJsonFile

func WriteJsonFile(outputFile string, data []byte) error

WriteJsonFile writes JSON data to the specified file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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