208 lines
4.5 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
File::UserDirs - find extra media and documents directories
|
|
<A NAME="lbAC"> </A>
|
|
<H2>VERSION</H2>
|
|
|
|
|
|
|
|
This document describes File::UserDirs version <TT>0.04</TT>.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use File::UserDirs qw(:all);
|
|
print xdg_desktop_dir; # e.g. /home/user/Desktop
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAE"> </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"> </A>
|
|
<H2>INTERFACE</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">"xdg_desktop_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the desktop directory. Unless changed by the user,
|
|
this is the directory <I>Desktop</I> in the home directory.
|
|
<DT id="2">"xdg_documents_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the documents directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="3">"xdg_download_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the download directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="4">"xdg_music_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the music directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="5">"xdg_pictures_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the pictures directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="6">"xdg_publicshare_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the public share directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="7">"xdg_templates_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the templates directory. Unless changed by the user,
|
|
this is the home directory.
|
|
<DT id="8">"xdg_videos_dir"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the videos directory. Unless changed by the user,
|
|
this is the home directory.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXPORTS</H2>
|
|
|
|
|
|
|
|
None by default, but any method can be exported on demand.
|
|
Also the group <TT>":all"</TT> is defined which exports all methods.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>DIAGNOSTICS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="9">""xdg-user-dir" failed to start: %s"<DD>
|
|
|
|
|
|
|
|
|
|
The executable <TT>"xdg-user-dir"</TT> could not be run, most likely because it was not
|
|
installed. See ``<FONT SIZE="-1">DEPENDENCIES''</FONT>.
|
|
</DL>
|
|
<A NAME="lbAI"> </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"> </A>
|
|
<H3>Example customised <I>user-dirs.dirs</I></H3>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
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"
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>DEPENDENCIES</H2>
|
|
|
|
|
|
|
|
This module requires the executable <I>xdg-user-dir</I> from the package
|
|
<TT>"xdg-user-dirs"</TT>. Source code is available from
|
|
<<A HREF="http://cgit.freedesktop.org/xdg/xdg-user-dirs/">http://cgit.freedesktop.org/xdg/xdg-user-dirs/</A>>.
|
|
<A NAME="lbAL"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </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>
|