helpers

package
v0.0.0-...-05a7082 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MadeChanges bool

a variable that store if we made any changes to files

View Source
var ORGANIZED bool

a variable that turns to true if we made changes to user files

Functions

func AlreadyInCategorizedFolder

func AlreadyInCategorizedFolder(to, parentFilePath string) bool
checks if the file we want to create folder for it is not in a folder that has

been created before for categorization

func CategorizeFiles

func CategorizeFiles(filePaths *[]string) error

func CheckDuplicate

func CheckDuplicate(dirPath string, files *[]string) ([]string, error)

func CheckFileOrFolderNotExist

func CheckFileOrFolderNotExist(path string) bool

func Compress

func Compress(deepSearchFlag, removeEmptyDirsFlag bool) error

func CompressToZip

func CompressToZip(filesPath *[]string, dirPath string) error

compresses file to zip

func CreateCommonFileMap

func CreateCommonFileMap(folderToLookFor string, deepSearch, removeEmptyDirs bool) (map[string]*CommonFileInfo, error)

func CreateDirectories

func CreateDirectories(dirs map[string][]string) error

func GetFileChoosen

func GetFileChoosen(filesPath *[]string, dirPath string) ([]string, error)

func GetFileContent

func GetFileContent(filePath string) (*os.File, string, string, error)

gets information we need for comperssing a file like it content in bytes and it name and extension

func GreenLog

func GreenLog(text string)

func HashFile

func HashFile(filePath string) (string, error)

func MoveFile

func MoveFile(from, to string) error

func MoveToCommonFolder

func MoveToCommonFolder(folderToLookFor string, deepSearch, removeEmptyDirs bool) error

func ReadFiles

func ReadFiles(dirPath string, deepSearchFlag, removeEmptyDirsFlag bool) (*[]string, error)

reads all files in a directory

func RedLog

func RedLog(text string)

func RemoveDuplicates

func RemoveDuplicates(dirPath string, filePaths *[]string) error

func RenameFile

func RenameFile(filePath, filename string) string

func SortByDateModified

func SortByDateModified(files *[]string, descending bool)

func SortBySize

func SortBySize(files *[]string, descending bool)

func SortFiles

func SortFiles(files *[]string) error

func YellowLog

func YellowLog(text string)

Types

type CommonFileInfo

type CommonFileInfo struct {
	Count int
	Path  []string
}

Jump to

Keyboard shortcuts

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