Documentation
¶
Index ¶
- func CreateEmptyFile(path string) error
- func CreateFileBackup(fName string)
- func CreateFileWithContent(path, content string) error
- func CreateLinkIfNotExists(source string, check CheckLinkSource, destination string, logger log.Logger) error
- func DoAbsolutePath(p string, shouldBeDir bool) (string, error)
- func FileExistsInDirAndParentsDirs(dir, fileName string) (string, error)
- func GetSystemDirectories() []string
- func IsDirExists(dir string) bool
- func IsExists(path string) (bool, error)
- func IsInSystemDirs(dir string) (bool, []string)
- func IsRoot(dir string) bool
- func IsSymlinkFromDirEntry(fullPath string, e fs.DirEntry) (bool, string, error)
- func IsSymlinkFromInfo(fullPath string, stat fs.FileInfo) (bool, string, error)
- func IsSystemDirOrUserHome(dir string) (bool, []string, error)
- func RandomNumberSuffix(name string) string
- func RandomTmpDirWithNRunes(rootDir, idSalt string, firstIdRunes int) (string, error)
- func RandomTmpFileName() string
- func RevealWildcardPaths(paths []string) []string
- func StartFileWatcher(path string, fsEventHanlder func(event fsnotify.Event), done chan struct{}, ...) (*fsnotify.Watcher, error)
- func TouchFile(path string) error
- func WriteContentIfNeed(file string, newContent []byte) error
- type CheckLinkSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyFile ¶
func CreateFileBackup ¶
func CreateFileBackup(fName string)
func CreateFileWithContent ¶
func CreateLinkIfNotExists ¶
func FileExistsInDirAndParentsDirs ¶
FileExistsInDirAndParentsDirs returns empty string if not found otherwise full path
func GetSystemDirectories ¶
func GetSystemDirectories() []string
func IsDirExists ¶
func IsInSystemDirs ¶
func IsSymlinkFromDirEntry ¶
func IsSymlinkFromInfo ¶
func IsSystemDirOrUserHome ¶
IsSystemDirOrUserHome dir must be absolute and cleaned
func RandomNumberSuffix ¶
The suffix will consist of 128 bits of non-secure randomness composed in 32 hex digits, 16 bytes. For example, for "name-here" the call will produce something like "name-here-7d03f3e265dace994308fc812e9ab366"
func RandomTmpDirWithNRunes ¶
func RandomTmpFileName ¶
func RandomTmpFileName() string
func RevealWildcardPaths ¶
func StartFileWatcher ¶
func WriteContentIfNeed ¶
Types ¶
type CheckLinkSource ¶
Click to show internal directories.
Click to hide internal directories.