AppDirs
Documentation for AppDirs.
AppDirs.jl is a port of appdirs to Julia. It lets you find the appropriate directory to save caches, logs, and data, on Linux, Mac, and Windows.
AppDirs.AppDir
AppDirs.site_config_dir
AppDirs.site_data_dir
AppDirs.user_cache_dir
AppDirs.user_config_dir
AppDirs.user_data_dir
AppDirs.user_log_dir
AppDirs.user_state_dir
AppDirs.user_data_dir
— Functionuser_data_dir(appname=nothing, appauthor=nothing, version=nothing,
roaming::Bool=false)
Return full path to the user-specific data dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.roaming
(defaultfalse
) can be settrue
to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See here for a discussion of issues.
Typical user data directories are:
Setting | Path |
---|---|
macOS | ~/Library/Application Support/<AppName> |
Unix | ~/.local/share/<AppName> (or in XDG_DATA_HOME , if defined) |
Win XP (not roaming) | C:\Documents and Settings\<username>\Application Data\<AppAuthor>\<AppName> |
Win XP (roaming) | C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName> |
Win 7 (not roaming) | C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName> |
Win 7 (roaming) | C:\Users\<username>\AppData\Roaming\<AppAuthor>\<AppName> |
AppDirs.site_data_dir
— Functionsite_data_dir(appname=nothing, appauthor=nothing; version=nothing,
multipath::Bool=false)
Return full path to the user-shared data dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.multipath
is an optional parameter only applicable to *nix which indicates that the entire list of data dirs should be returned. By default, the first item fromXDG_DATA_DIRS
is returned, or/usr/local/share/<AppName>
, ifXDG_DATA_DIRS
is not set
Typical site data directories are:
Setting | Path |
---|---|
macOS | /Library/Application Support/<AppName> |
Unix | /usr/local/share/<AppName> or /usr/share/<AppName> |
Win XP | C:\Documents and Settings\All Users\Application Data\<AppAuthor>\<AppName> |
Win Vista | (Fail! C:\ProgramData is a hidden system directory on Vista) |
Win 7 | C:\ProgramData\<AppAuthor>\<AppName> (Hidden, but writeable on Win 7) |
Do not use this on Windows. See the Vista-Fail note above for why.
AppDirs.user_config_dir
— Functionuser_config_dir(appname=nothing, appauthor=nothing; version=nothing,
roaming::Bool=false)
Return full path to the user-specific config dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.roaming
(defaultfalse
) can be settrue
to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See here for a discussion of issues.
Typical user config directories are:
Setting | Path |
---|---|
macOS | ~/Library/Preferences/<AppName> |
Unix | ~/.config/<AppName> (or in XDG_CONFIG_HOME , if defined) |
Windows | same as user_data_dir |
AppDirs.site_config_dir
— Functionsite_config_dir(appname=nothing, appauthor=nothing; version=nothing,
multipath::Bool=false)
Return full path to the user-shared config dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.multipath
is an optional parameter only applicable to *nix which indicates that the entire list of config dirs should be returned. By default, the first item fromXDG_CONFIG_DIRS
is returned, or/etc/xdg/<AppName>
, ifXDG_CONFIG_DIRS
is not set
Typical site config directories are:
Setting | Path |
---|---|
macOS | /Library/Preferences |
Unix | /etc/xdg/<AppName> or XDG_CONFIG_DIRS[i]/<AppName> for each value in XDG_CONFIG_DIRS |
Windows | same as site_data_dir |
Win Vista | (Fail! C:\ProgramData is a hidden system directory on Vista) |
Do not use this on Windows. See the Vista-Fail note above for why.
AppDirs.user_cache_dir
— Functionuser_cache_dir(appname=nothing, appauthor=nothing; version=nothing,
opinion::Bool=true)
Return full path to the user-specific cache dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.opinion
(defaulttrue
) can befalse
to disable the appending ofCache
to the base app data dir for Windows. See discussion below.
Typical user cache directories are:
Setting | Path |
---|---|
macOS | ~/Library/Caches/<AppName> |
Unix | ~/.cache/<AppName> (or in XDG_CACHE_HOME , if defined) |
Win XP | C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>\Cache |
Win 7 | C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName>\Cache |
On Windows the only suggestion in the MSDN docs is that local settings go in the CSIDL_LOCAL_APPDATA
directory. This is identical to the non-roaming app data dir (the default returned by user_data_dir
). Apps typically put cache data somewhere under the given dir here. Some examples:
...\Mozilla\Firefox\Profiles\<ProfileName>\Cache
...\Acme\SuperApp\Cache\1.0
AppDirs.user_state_dir
— Functionuser_state_dir(appname=nothing, appauthor=nothing; version=nothing,
roaming::Bool=false)
Return full path to the user-specific state dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.roaming
(defaultfalse
) can be settrue
to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See here for a discussion of issues.
Typical user state directories are:
Setting | Path |
---|---|
macOS | same as user_data_dir |
Unix | ~/.local/state/<AppName> (or XDG_STATE_HOME if defined) |
Windows | same as user_data_dir |
AppDirs.user_log_dir
— Functionuser_log_dir(appname=nothing, appauthor=nothing, version=nothing,
opinion::Bool=true)
Return full path to the user-specific log dir for this application.
appname
is the name of application. Ifnothing
, just the system directory is returned.appauthor
(only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back toappname
. You may passfalse
to disable it.version
is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be"<major>.<minor>"
. Only applied whenappname
is present.opinion
(defaulttrue
) can befalse
to disable the appending ofLogs
to the base app data dir for Windows, andlog
to the base cache dir for Unix. See discussion below.
Typical user log directories are:
Setting | Path |
---|---|
macOS | ~/Library/Logs/<AppName> |
Unix | ~/.cache/<AppName>/log (or under XDG_CACHE_HOME , if defined) |
Win XP | C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>\Logs |
Win 7 | C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName>\Logs |
On Windows the only suggestion in the MSDN docs is that local settings go in the CSIDL_LOCAL_APPDATA
directory.
AppDirs.AppDir
— TypeAppDir(appname=nothing, appauthor=nothing, version=nothing,
roaming::Bool=false, multipath::Bool=false)
Convenience wrapper for getting application dirs, with the following fields:
data
: the output ofuser_data_dir
site_data
: the output ofsite_data_dir
config
: the output ofuser_config_dir
site_config
: the output ofsite_config_dir
cache
: the output ofuser_cache_dir
state
: the output ofuser_state_dir
log
: the output ofuser_log_dir