08 Jul 2021 20:04:54 UTC
- Distribution: File-BaseDir
- Module version: 0.09
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (170 / 0 / 0)
- KwaliteeBus factor: 1
- 86.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (21KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:3 non-PAUSE usersPLICEASE 🦖🦜Graham Ollis🦃🦕and 1 contributors
- CONFIGURATION AND ENVIRONMENT
- COPYRIGHT AND LICENSE
File::UserDirs - Find extra media and documents directories
use File::UserDirs qw(:all); print xdg_desktop_dir; # e.g. /home/user/Desktop
This module can be used to find directories as informally specified by the Freedesktop.org xdg-user-dirs software. This gives a mechanism to locate extra directories for media and documents files.
May be exported on request. Also the group
:allis defined which exports all methods.
my $dir = xdg_desktop_dir;
Returns the desktop directory. Unless changed by the user, this is the directory Desktop in the home directory.
my $dir = xdg_documents_dir;
Returns the documents directory. Unless changed by the user, this is the home directory.
my $dir = xdg_download_dir;
Returns the download directory. Unless changed by the user, this is the home directory.
my $dir = xdg_music_dir;
Returns the music directory. Unless changed by the user, this is the home directory.
my $dir = xdg_pictures_dir;
Returns the pictures directory. Unless changed by the user, this is the home directory.
my $dir = xdg_publicshare_dir;
Returns the public share directory. Unless changed by the user, this is the home directory.
my $dir = xdg_templates_dir;
Returns the templates directory. Unless changed by the user, this is the home directory.
my $dir = xdg_videos_dir;
Returns the videos directory. Unless changed by the user, this is the home directory.
"xdg-user-dir" failed to start: %s
xdg-user-dircould not be run, most likely because it was not installed. See "DEPENDENCIES".
The location of the directories can be specified by the user in the file $XDG_CONFIG_HOME/user-dirs.dirs. It is a shell file setting a number of environment variables. To find the exact pathname from Perl, run:
use File::BaseDir qw(config_home); print config_home('user-dirs.dirs');
XDG_DESKTOP_DIR="$HOME/Workspace" XDG_DOCUMENTS_DIR="$HOME/Files" XDG_DOWNLOAD_DIR="$HOME/Files/Downloads" XDG_MUSIC_DIR="$HOME/Files/Audio" XDG_PICTURES_DIR="$HOME/Files/Images" XDG_PUBLICSHARE_DIR="$HOME/public_html" XDG_TEMPLATES_DIR="$HOME/Files/Document templates" XDG_VIDEOS_DIR="$HOME/Files/Video"
This module requires the executable xdg-user-dir from the package
xdg-user-dirs. Source code is available from http://cgit.freedesktop.org/xdg/xdg-user-dirs/.
Jaap Karssenberg || Pardus [Larus] <email@example.com>
Graham Ollis <firstname.lastname@example.org>
This software is copyright (c) 2003-2021 by Jaap Karssenberg || Pardus [Larus] <email@example.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install File::BaseDir, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install File::BaseDir
For more information on module installation, please visit the detailed CPAN module installation guide.