Documentation ¶
Overview ¶
Package fs holds some utilities for manipulating the file system
Index ¶
- func CopyFile(origFilePath, destFilePath string) (err error)
- func CopyFolder(origFolderPath, destFolderPath string) error
- func CreateSecureFile(file string) (*os.File, error)
- func CreateSecureFolder(folder string) string
- func Exists(filePath string) (bool, error)
- func FileExists(filePath, name string) bool
- func Files(folderPath string) ([]string, error)
- func FolderExists(folderPath, name string) bool
- func Folders(folderPath string) ([]string, error)
- func HomeFolder() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFolder ¶ added in v1.4.6
CopyFolder copy files inside a folder to another folder recursively
func CreateSecureFile ¶
CreateSecureFile creates a file with wr permission for user only and returns the file handle.
func CreateSecureFolder ¶
CreateSecureFolder checks if the folder exists and has the appropriate permission rights. In case of bad permission rights the empty string is returned. If the folder doesn't exist it, create it.
func FileExists ¶
FileExists returns true if the given name is a file in the given path. name must be the "basename" of the file and path must be the folder where it lies.
func FolderExists ¶ added in v1.4.6
FolderExists returns true if the given name is a folder in the given path. name must be the "basename" of the file and path must be the folder where it lies.
func Folders ¶ added in v1.4.6
Folders returns the list of folder names included in the given path or error if any.
func HomeFolder ¶ added in v0.3.7
func HomeFolder() string
HomeFolder returns the home folder of the current user.
Types ¶
This section is empty.