package
0.0.0-20240615164402-742bdff4c8c2
Repository: https://github.com/naive-x/utils.git
Documentation: pkg.go.dev
# README
folderutil
The package contains various helpers to interact with folders
UserConfigDirOrDefault
UserConfigDirOrDefault returns the default root directory to use for user-specific configuration data. Users should create their own application-specific subdirectory within this one and use that.
On Unix systems, it returns $XDG_CONFIG_HOME as specified by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.config. On Darwin, it returns $HOME/Library/Application Support. On Windows, it returns %AppData%. On Plan 9, it returns $home/lib.
If the location cannot be determined (for example, $HOME is not defined), then it will return given value as default.
# Functions
AppCacheDirOrDefault returns the user cache directory or defaultCacheDir in case of error.
AppConfigDirOrDefault returns the app config directory.
DedupeLinesInFiles deduplicates lines in all files in a directory The function can be memory intensive for directories with large files.
GetFiles within a folder.
HomeDirOrDefault tries to obtain the user's home directory and returns the default if it cannot be obtained.
No description provided by the author
No description provided by the author
IsWritable checks if a path is writable by attempting to create a temporary file.
NewPathInfo returns info about a given path.
Prints the standard directories for a tool.
SyncDirectory sync all files and non-empty directories from source to destination folder optionally removes source directory and removes source.
UserConfigDirOrDefault returns the user config directory or defaultConfigDir in case of error.
# Constants
No description provided by the author
No description provided by the author
# Variables
Remove source directory after successful sync.
Separator evaluated at runtime.