Documentation ¶
Overview ¶
Package fileutils provided a set of method for work with files
Index ¶
- func CompareBinaryFile(file1, file2 string, nByte int) bool
- func CountLines(fileName, separator string, bufferLength int) (int, error)
- func CreateDir(path string) error
- func ExtractWordFromFile(filename string) map[string]int
- func FileExists(filename string) bool
- func FilterFromFile(filename, target string, ignorecase bool) []string
- func FindFiles(path, target string, caseSensitive bool) []string
- func GetFileContentType(fileName string) (string, error)
- func GetFileDate(filepath string) string
- func GetFileModification(filepath string) int64
- func GetFileSize(filepath string) (int64, error)
- func GetFileSize2(filepath string) (int64, error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func ListFiles(path string) ([]string, error)
- func ListFilesOrdered(path string) ([]string, error)
- func Move(source, dest string) error
- func ReadFileInArray(filePath string) []string
- func Tail(FILE string, BUFF_BYTE int64, START_POS, N_STRING int) (string, error)
- func VerifyFilesExists(filePath string, files []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareBinaryFile ¶ added in v0.0.25
CompareBinaryFile is delegated to compare two files using chunks of byte
func CountLines ¶ added in v0.0.31
CountLines return the number of lines in the given file If called with an empty separator, new line will be used as default
func ExtractWordFromFile ¶ added in v0.0.23
ExtractWordFromFile is delegated to extract the word from a given file with the related frequencies
func FileExists ¶ added in v0.0.7
FileExists verify that the file exist
func FilterFromFile ¶ added in v0.0.18
FilterFromFile is delegated to retrieve the lines that contain the target
func FindFiles ¶
FindFiles is delegated to find the files from the given directory, recursively for each dir, and extract only the one that match the input
func GetFileContentType ¶ added in v0.0.5
GetFileContentType is delegated to retrieve the filetype for a given file path
func GetFileDate ¶
GetFileDate is delegated to return the date in a string format in which the file was (latest) modified
func GetFileModification ¶
GetFileModification return the last modification time of the file in input in a UNIX time format
func GetFileSize ¶ added in v0.0.11
GetFileSize is delegated to return the bytes size of the given file
func GetFileSize2 ¶ added in v0.0.11
GetFileSize2 is a less efficient method for calculate the file size
func ListFiles ¶ added in v0.0.76
ListFiles is delegated to find the files from the given directory, recursively for each dir
func ListFilesOrdered ¶ added in v0.0.76
func ReadFileInArray ¶
ReadFileInArray is delegated to read the file content as tokenize the data by the new line
func Tail ¶ added in v0.0.21
Tail is delegated to read the latest lines of the file. NOTE: buffer have to be lesser than the minimum string length
func VerifyFilesExists ¶
VerifyFilesExists is delegated to verify that the given list of file exist in the directory
Types ¶
This section is empty.