man-pages/man3/File::UserDirs.3pm.html
2021-03-31 01:06:50 +01:00

208 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of File::UserDirs</TITLE>
</HEAD><BODY>
<H1>File::UserDirs</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2018-05-11<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
File::UserDirs - find extra media and documents directories
<A NAME="lbAC">&nbsp;</A>
<H2>VERSION</H2>
This document describes File::UserDirs version <TT>0.04</TT>.
<A NAME="lbAD">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use File::UserDirs qw(:all);
print xdg_desktop_dir; # e.g. /home/user/Desktop
</PRE>
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>
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.
<A NAME="lbAF">&nbsp;</A>
<H2>INTERFACE</H2>
<DL COMPACT>
<DT id="1">&quot;xdg_desktop_dir&quot;<DD>
Returns the desktop directory. Unless changed by the user,
this is the directory <I>Desktop</I> in the home directory.
<DT id="2">&quot;xdg_documents_dir&quot;<DD>
Returns the documents directory. Unless changed by the user,
this is the home directory.
<DT id="3">&quot;xdg_download_dir&quot;<DD>
Returns the download directory. Unless changed by the user,
this is the home directory.
<DT id="4">&quot;xdg_music_dir&quot;<DD>
Returns the music directory. Unless changed by the user,
this is the home directory.
<DT id="5">&quot;xdg_pictures_dir&quot;<DD>
Returns the pictures directory. Unless changed by the user,
this is the home directory.
<DT id="6">&quot;xdg_publicshare_dir&quot;<DD>
Returns the public share directory. Unless changed by the user,
this is the home directory.
<DT id="7">&quot;xdg_templates_dir&quot;<DD>
Returns the templates directory. Unless changed by the user,
this is the home directory.
<DT id="8">&quot;xdg_videos_dir&quot;<DD>
Returns the videos directory. Unless changed by the user,
this is the home directory.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>EXPORTS</H2>
None by default, but any method can be exported on demand.
Also the group <TT>&quot;:all&quot;</TT> is defined which exports all methods.
<A NAME="lbAH">&nbsp;</A>
<H2>DIAGNOSTICS</H2>
<DL COMPACT>
<DT id="9">&quot;&quot;xdg-user-dir&quot; failed to start: %s&quot;<DD>
The executable <TT>&quot;xdg-user-dir&quot;</TT> could not be run, most likely because it was not
installed. See ``<FONT SIZE="-1">DEPENDENCIES''</FONT>.
</DL>
<A NAME="lbAI">&nbsp;</A>
<H2>CONFIGURATION AND ENVIRONMENT</H2>
The location of the directories can be specified by the user in the file
<I></I>$XDG_CONFIG_HOME<I>/user-dirs.dirs</I>. It is a shell file setting a number of
environment variables. To find the exact pathname from Perl, run:
<P>
<PRE>
use File::BaseDir qw(config_home);
print config_home('user-dirs.dirs');
</PRE>
<A NAME="lbAJ">&nbsp;</A>
<H3>Example customised <I>user-dirs.dirs</I></H3>
<PRE>
XDG_DESKTOP_DIR=&quot;$HOME/Workspace&quot;
XDG_DOCUMENTS_DIR=&quot;$HOME/Files&quot;
XDG_DOWNLOAD_DIR=&quot;$HOME/Files/Downloads&quot;
XDG_MUSIC_DIR=&quot;$HOME/Files/Audio&quot;
XDG_PICTURES_DIR=&quot;$HOME/Files/Images&quot;
XDG_PUBLICSHARE_DIR=&quot;$HOME/public_html&quot;
XDG_TEMPLATES_DIR=&quot;$HOME/Files/Document templates&quot;
XDG_VIDEOS_DIR=&quot;$HOME/Files/Video&quot;
</PRE>
<A NAME="lbAK">&nbsp;</A>
<H2>DEPENDENCIES</H2>
This module requires the executable <I>xdg-user-dir</I> from the package
<TT>&quot;xdg-user-dirs&quot;</TT>. Source code is available from
&lt;<A HREF="http://cgit.freedesktop.org/xdg/xdg-user-dirs/">http://cgit.freedesktop.org/xdg/xdg-user-dirs/</A>&gt;.
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="10"><A HREF="#lbAB">NAME</A><DD>
<DT id="11"><A HREF="#lbAC">VERSION</A><DD>
<DT id="12"><A HREF="#lbAD">SYNOPSIS</A><DD>
<DT id="13"><A HREF="#lbAE">DESCRIPTION</A><DD>
<DT id="14"><A HREF="#lbAF">INTERFACE</A><DD>
<DT id="15"><A HREF="#lbAG">EXPORTS</A><DD>
<DT id="16"><A HREF="#lbAH">DIAGNOSTICS</A><DD>
<DT id="17"><A HREF="#lbAI">CONFIGURATION AND ENVIRONMENT</A><DD>
<DL>
<DT id="18"><A HREF="#lbAJ">Example customised <I>user-dirs.dirs</I></A><DD>
</DL>
<DT id="19"><A HREF="#lbAK">DEPENDENCIES</A><DD>
<DT id="20"><A HREF="#lbAL">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:43 GMT, March 31, 2021
</BODY>
</HTML>