io

package
v0.0.0-...-614ae31 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsFileSizeSame

func CheckIsFileSizeSame(paths ...string) error

CheckIsFileSizeSame verifies if all files in the provided paths have the same apparent and actual size. It returns an error if any file is a directory, does not exist, or has a different size.

func CopyDirectory

func CopyDirectory(sourcePath, destinationPath string, doOverWrite bool) error

CopyDirectory copies the directory from source to destination.

func CopyFile

func CopyFile(sourcePath, destinationPath string, overWrite bool) error

CopyFile copies the file from source to destination.

func CopyFiles

func CopyFiles(sourcePath, destinationPath string, doOverWrite bool) error

CopyFiles copies the files from source to destination.

func CreateDirectory

func CreateDirectory(path string, modTime time.Time) (string, error)

CreateDirectory creates a directory at the specified path, and sets the modification time.

func FindFiles

func FindFiles(directory, fileName string, maxDepth int) (filePaths []string, err error)

FindFiles searches for files in the specified directory with the given fileName. If fileName is empty, it retrieves all files in the directory. If maxDepth is greater than 0, it limits the search to the specified depth. It returns a slice of filePaths and an error if any.

func GetDiskStat

func GetDiskStat(path string) (diskStat types.DiskStat, err error)

GetDiskStat returns the disk stat for the specified path.

func GetEmptyFiles

func GetEmptyFiles(directory string) (filePaths []string, err error)

GetEmptyFiles retrieves a list of paths for all empty files within the specified directory. It uses filepath.Walk to traverse the directory and finds files with zero size. It returns a slice of filePaths and an error if any.

func IsDirectoryEmpty

func IsDirectoryEmpty(directory string) (bool, error)

IsDirectoryEmpty returns true if the specified directory is empty.

func ListOpenFiles

func ListOpenFiles(procDirectory, directory string) ([]string, error)

ListOpenFiles returns a list of open files in the specified directory.

func ReadFileContent

func ReadFileContent(filePath string) (string, error)

ReadFileContent reads the content of the file.

func SyncFile

func SyncFile(filePath string) error

SyncFile syncs the file to the disk.

Types

This section is empty.

Jump to

Keyboard shortcuts

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