nrfiles

package
v0.0.0-...-261f9d3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseFile

func CloseFile(file *os.File)

CloseFile will close the provided file swallowing any error produced. This function is intended to be called with defer and is primarily intended to remove IDE warnings caused by calling defer file.Close()

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir copies a directory preserving permissions. This function will return an error if it encounters a symlink.

func CopyFile

func CopyFile(src, dst string) (int64, error)

CopyFile copies the contents of the source file (src) to the destination file (dst). The file will be created if it doesn't exit and will be overwritten if it already exists. The number of bytes wirten is returned.

func DirEmpty

func DirEmpty(path ...string) (bool, error)

DirEmpty checks if the give directory path is empty of files and other directories. This function will return an error if the directory does not exists or is a file

func DirExists

func DirExists(path ...string) bool

DirExists checks if the given path exits and is a directory.

func FileExists

func FileExists(path ...string) bool

FileExists checks if the given path exists and is not a directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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