fsutil

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirEmpty

func CheckDirEmpty(path string) (bool, error)

CheckDirEmpty checks if the directory is empty.

func CleanCreateDir

func CleanCreateDir(path string) error

CleanCreateDir deletes the given dir and then re-creates it.

func CleanDir

func CleanDir(path string) error

CleanDir deletes the given dir.

func ConvertPathsToRelative

func ConvertPathsToRelative(baseDir string, paths []string) error

ConvertPathsToRelative converts a list of paths to relative. Enforces that none of the paths are below the base dir. Deduplicates the list of paths.

func CopyFile

func CopyFile(dst, src string, perm os.FileMode) error

CopyFile copies the contents from src to dst.

func CopyFileToDir

func CopyFileToDir(dstDir, src string, perm os.FileMode) error

CopyFileToDir copies the file to the dir maintaining the filename.

func CopyRecursive

func CopyRecursive(dstDir, src string, cb fs.WalkDirFunc) error

CopyRecursive copies regular files & directories from src to dest.

Calls the callback with the absolute path to the source file.

func MoveFile added in v1.12.2

func MoveFile(dst, src string, perm os.FileMode) error

MoveFile moves the contents from src to dst.

func MoveFileToDir added in v1.12.2

func MoveFileToDir(dstDir, src string, perm os.FileMode) error

MoveFileToDir moves the contents from src to dstDir maintaining the filename.

Types

This section is empty.

Jump to

Keyboard shortcuts

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