fsutil

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: GPL-3.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSrcNotRegularFile : src not a regular file
	ErrSrcNotRegularFile = errors.New("Source file is not a regular file")
	// ErrDstNotRegularFile : dst not a regular file
	ErrDstNotRegularFile = errors.New("Destination file is not a regular file")
)

Functions

func AbsFromRelativeToBin

func AbsFromRelativeToBin(relPath ...string) (string, error)

AbsFromRelativeToBin : function that returns the absolute path to a file/directory computed with the directory of the binary as the root Example : if bin is /opt/program this function will return an absolute path computed as relative to /opt/ @relPath : the parts of the path you want to Join in your final path return (string, error) : the absolute path and an error if necessary

func CopyFile

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

CopyFile : copies src file to dst file

func Exists

func Exists(path string) bool

Exists returns true if file at path exists

func IsDir

func IsDir(path string) bool

IsDir returns true if path is a directory

func IsFile

func IsFile(path string) bool

IsFile returns true if path is a file

func IsLink(path string) bool

IsLink returns true if path is a Symlink

func ResolveLink(path string) (string, error)

ResolveLink resolves the link if it is a Link or return the original path

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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