io

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Slash = "/"
)

Variables

This section is empty.

Functions

func CopyDir added in v0.11.0

func CopyDir(dst, src string, skip func(path string) bool) error

CopyDir recursively copies all the files within the directory given in src to the directory given in dst.

Both directories should already exist. If the destination directory is non-empty then the new files will merge in with the old, overwriting any files that have a relative path in common between source and destination.

func CopyFile added in v0.11.0

func CopyFile(source, dest string) error

CopyFile copies the file at source to dest

func CreateDirIfNotExist

func CreateDirIfNotExist(dirPath string) error

CreateDirIfNotExist creates dir recursively if not exist Note: input argument must be a dirPath

func IsDir

func IsDir(path string) (bool, error)

IsDir checks whether the path is a dir

func IsFile

func IsFile(path string) (bool, error)

IsFile checks whether the path is a file

func IsFileOrDirExist

func IsFileOrDirExist(path string) bool

IsFileOrDirExist checks whether a file or a dir exists

func OutDir

func OutDir(path string) (string, error)

OutDir returns an absolute representation of path after dir check Returns absolute path including trailing '/' or error if path does not exist.

func RenamePath

func RenamePath(oldPath, newPath string) error

RenamePath renames (moves) oldPath to newPath, and creates needed directories in newPath If newPath already exists, RenamePath will return an error

func SameFile added in v0.11.0

func SameFile(a, b string) (bool, error)

SameFile returns true if the two given paths refer to the same physical file on disk, using the unique file identifiers from the underlying operating system. For example, on Unix systems this checks whether the two files are on the same device and have the same inode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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