Documentation ¶
Index ¶
- Constants
- func CreateDirectory(name string) error
- func DeleteDirectory(name string) error
- func DeleteFile(name string) error
- func FindFilesByName(name, dir string) ([]string, []fs.DirEntry, error)
- func GetDirectoryItemSize(path string) (int64, error)
- func GetDirectoryListing(dir string, showHidden bool) ([]fs.DirEntry, error)
- func GetDirectoryListingByType(dir, listingType string, showHidden bool) ([]fs.DirEntry, error)
- func GetHomeDirectory() (string, error)
- func GetWorkingDirectory() (string, error)
- func MoveDirectoryItem(src, dst string) error
- func ReadFileContent(name string) (string, error)
- func RenameDirectoryItem(src, dst string) error
- func WriteToFile(path, content string) error
Constants ¶
const ( CurrentDirectory = "." PreviousDirectory = ".." HomeDirectory = "~" RootDirectory = "/" )
Directory shortcuts.
const ( DirectoriesListingType = "directories" FilesListingType = "files" )
Different types of listings.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
CreateDirectory creates a new directory given a name.
func DeleteDirectory ¶
DeleteDirectory deletes a directory given a name.
func GetDirectoryItemSize ¶
GetDirectoryItemSize calculates the size of a directory or file.
func GetDirectoryListing ¶
GetDirectoryListing returns a list of files and directories within a given directory.
func GetDirectoryListingByType ¶
GetDirectoryListingByType returns a directory listing based on type (directories | files).
func GetHomeDirectory ¶
GetHomeDirectory returns the users home directory.
func GetWorkingDirectory ¶
GetWorkingDirectory returns the current working directory.
func MoveDirectoryItem ¶
MoveDirectoryItem moves a file from one place to another.
func ReadFileContent ¶
ReadFileContent returns the contents of a file given a name.
func RenameDirectoryItem ¶
RenameDirectoryItem renames a directory or files given a source and destination.
func WriteToFile ¶
WriteToFile writes content to a file, overwriting content if it exists.
Types ¶
This section is empty.