ioex

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 5 Imported by: 0

README

ioex

Custom supplements to io.

License

MIT

See included LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAll

func CopyAll(destination, source string, overwrite bool) error

CopyAll copies from source to destination where destination must be a directory if it exists or will be created as directory if it does not. If it exists and is not a directory CopyAll returns os.ErrExist.

Source can be a file or a directory. If it is a file it is copied to destination. If it is a directory it is enumerated and all its children are copied to destination creating subdirectories at destination as needed.

Symbolic links are skipped silently. Copying one is a noop and returns nil.

If overwrite is specified it silently overwrites existing destination files, otherwise returns an os.Exists mid operation with incomplete copy results.

Permissions of source files and directories carry over to destinations.

If any other error occurs is returned and it will be of type *os.PathError.

func CopyFile added in v0.0.3

func CopyFile(destination, source string, overwrite bool) error

CopyFile copies source file to destination file along with permissions or returns an error. Symlinks are skipped and return a nil error.

func Exists added in v0.0.2

func Exists(filename string) (bool, error)

Exists returns if the file specified by filename exists. If an error occurs it is returned and the exists result is invalid.

func Touch

func Touch(filename string) error

Touch updates access and modification times of specified file. It creates any required directories along the optionally specified path. If the file does not exist it is created. If an error occurs it is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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