Documentation ¶
Index ¶
- Variables
- func CommonPrefix(sep byte, paths ...string) string
- func Copy(fsys afero.Fs, from, to string) (err error)
- func CopyDir(fs afero.Fs, source, dest string) error
- func CopyFile(fs afero.Fs, source, dest string) error
- func MakeDirIfNotExist(fs afero.Fs, path string) error
- func MkFileIfNotExist(fs afero.Fs, path string) error
- func MoveDir(fs afero.Fs, source, dest string) error
- func MoveFile(fs afero.Fs, src, dst string) error
- func MoveFileMany(ctx context.Context, fs afero.Fs, src []string, dst string) []error
- func MoveOrCopy(fs afero.Fs, src, dst string) error
- func Remove(ctx context.Context, fs afero.Fs, file string) error
- func RemoveMany(ctx context.Context, fs afero.Fs, files []string) []error
- func RenameOrCopy(fsys afero.Fs, from, to string) error
Constants ¶
This section is empty.
Variables ¶
var PathAlreadyExistsError = &os.PathError{Op: "Create", Err: os.ErrExist}
Functions ¶
func CommonPrefix ¶
CommonPrefix returns common directory path of provided files
func Copy ¶
Copy copies the file content from source to destination. Tries hard to succeed on various systems by temporarily tweaking directory permissions and removing the destination file when necessary.
func CopyDir ¶
CopyDir copies a directory from source to dest and all of its sub-directories. It doesn't stop if it finds an error during the copy. Returns an error if any.
func MakeDirIfNotExist ¶
MakeDirIfNotExist creates a directory if it does not exist.
func MkFileIfNotExist ¶
MkFileIfNotExist creates a file if it does not exist returns an error if the file already exists
func MoveDir ¶
MoveDir moves a directory from source to dest and all of its sub-directories. It doesn't stop if it finds an error during the move. Returns an error if any.
func MoveFile ¶
MoveFile moves file from src to dst. By default the rename filesystem system call is used. If src and dst point to different volumes the file copy is used as a fallback
func MoveFileMany ¶
MoveFileMany moves files from src into dst. By default the rename filesystem system call is used. If src and dst point to different volumes the file copy is used as a fallback
func MoveOrCopy ¶
MoveOrCopy moves or copies a file or directory from src to dst. Both src and dst must be absolute paths. A rename is attempted but if it fails a copy operation is performed.
func Remove ¶
Remove removes a file or directory If the file is a directory, this removes the directory and any children it contains.
func RemoveMany ¶
RemoveMany removes many files and/or directories If any path points to a directory, it and all children will be removed.
Types ¶
This section is empty.