Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotDirectory = errors.New("not directory")
ErrNotDirectory is returned when the path is not a directory.
var ErrNotRegularFile = errors.New("not regular file")
ErrNotRegularFile is returned when the file is not an regular file.
Functions ¶
func CopyDirToDir ¶ added in v1.1.0
CopyDirToDir copies contents in src dir to dst dir. Only regular files are copied. Existing files will be overwritten.
func CopyToDir ¶ added in v1.1.0
CopyToDir copies the src file to dst dir. All parent directories are created with permissions 0755.
Source file's read and execute permissions are preserved for everyone. Write permission is preserved for owner. Group and others cannot write. Existing file will be overwritten.
func IsValidFileName ¶
IsValidFileName checks if a file name is cross-platform compatible
func TrimFileExtension ¶ added in v1.1.0
TrimFileExtension returns the file name without extension.
For example,
when input is xyz.exe, output is xyz
when input is xyz.tar.gz, output is xyz.tar
func WriteFile ¶ added in v1.3.0
WriteFile writes content to a temporary file and moves it to path. If path already exists and is a file, WriteFile overwrites it.
Parameters:
- tempDir is the directory to create the temporary file. It should be in the same mount point as path. If tempDir is empty, the default directory for temporary files is used.
- path is the destination file path.
- content is the content to write.
Types ¶
This section is empty.