file

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDirectory = errors.New("not directory")

ErrNotDirectory is returned when the path is not a directory.

View Source
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

func CopyDirToDir(src, dst string) error

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

func CopyToDir(src, dst string) error

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

func IsValidFileName(fileName string) bool

IsValidFileName checks if a file name is cross-platform compatible

func TrimFileExtension added in v1.1.0

func TrimFileExtension(fileName string) string

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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