CommonDirs
This is the documentation for the common directories package, that is inside github.com/chordflower/vimle/pkg/commondirs
, and that contains functions to obtain the common user and system directories for certain files in Linux and macOS systems. For the directories in bold, the path is specific to the requesting application.
The obtainable system directories are:
- BinaryPath → Places where binary files can be;
- DevDir → Location where device files are placed;
- ConfigDir → Location where system configuration files are placed;
- SharedDir → Location where shared data can be placed;
- VariableDir → Location where variable files can be placed;
- CacheDir → Location where cache files can be placed;
- StateDir → Location where state files can be placed;
- LockDir → Location where lock files can be placed;
- LogDir → Location where log files can be placed;
- SocketDir → Location where unix socket files can be placed.
Note that these directories normally, cannot be written (or possibly even read) by anyone except the root or administrator of a system.
The obtainable user directories are:
- SharedDir → Location where user-specific data files can be placed;
- ConfigDir → Location where user-specific configuration files can be placed;
- StateDir → Location where user-specific state files can be placed;
- BinaryDir → Location where user-specific binary files can be placed;
- CacheDir → Location where user-specific cache files can be placed;
- RuntimeDir → Location where user-specific runtime files can be placed;
- LockDir → Location where user-specific lock files can be placed;
- LogDir → Location where user-specific log files can be placed;
- SocketDir → Location where user-specific unix socket files can be placed;
- DesktopDir → Location of the user desktop directory;
- DocumentsDir → Location of the user documents directory;
- DownloadsDir → Location of the user downloads directory;
- MusicDir → Location of the user music directory;
- ImageDir → Location of the user image directory;
- VideosDir → Location of the user videos directory.
Types
In terms of types these are the three main available interfaces, which are implemented for posix and macos respectively:
To obtain access to a usable implementation of CommonDirectories, the function GetCommonDirectories is used:
1 2 3 |
|