File::XDG - Basic implementation of the XDG base directory specification
File::XDG
use File::XDG; my $xdg = File::XDG->new(name => 'foo'); # user config $xdg->config_home # user data $xdg->data_home # user cache $xdg->cache_home # system config $xdg->config_dirs # system data $xdg->data_dirs
This module provides a basic implementation of the XDG base directory specification as exists by the Free Desktop Organization (FDO). It supports all XDG directories except for the runtime directories, which require session management support in order to function.
Returns a new instance of a File::XDG object. This must be called with an application name as the name argument.
name
Takes the following named arguments:
Name of the application for which File::XDG is being used.
Returns the user-specific data directory for the application as a Path::Class object.
Path::Class
Returns the user-specific configuration directory for the application as a Path::Class object.
Returns the user-specific cache directory for the application as a Path::Class object.
Returns the system data directories, not modified for the application. Per the specification, the returned string is :-delimited.
Returns the system config directories, not modified for the application. Per the specification, the returned string is :-delimited.
Looks up the data file by searching for ./subdir/filename relative to all base directories indicated by $XDG_DATA_HOME and $XDG_DATA_DIRS. If an environment variable is either not set or empty, its default value as defined by the specification is used instead. Returns a Path::Class object.
Looks up the configuration file by searching for ./subdir/filename relative to all base directories indicated by $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS. If an environment variable is either not set or empty, its default value as defined by the specification is used instead. Returns a Path::Class object.
XDG Base Directory specification, version 0.7
This module's Windows support is made possible by File::HomeDir. I would also like to thank Path::Class and File::Spec.
File::HomeDir
File::Spec
Kiyoshi Aman <kiyoshi.aman@gmail.com>
To install File::XDG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::XDG
CPAN shell
perl -MCPAN -e shell install File::XDG
For more information on module installation, please visit the detailed CPAN module installation guide.