{"id":7346,"date":"2022-12-20T19:37:46","date_gmt":"2022-12-20T22:37:46","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/fileuserdirs-man3\/"},"modified":"2022-12-20T19:37:46","modified_gmt":"2022-12-20T22:37:46","slug":"fileuserdirs-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/fileuserdirs-man3\/","title":{"rendered":"File::UserDirs (man3)"},"content":{"rendered":"<h1 align=\"center\">File::UserDirs<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#VERSION\">VERSION<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#INTERFACE\">INTERFACE<\/a><br \/> <a href=\"#EXPORTS\">EXPORTS<\/a><br \/> <a href=\"#DIAGNOSTICS\">DIAGNOSTICS<\/a><br \/> <a href=\"#CONFIGURATION AND ENVIRONMENT\">CONFIGURATION AND ENVIRONMENT<\/a><br \/> <a href=\"#DEPENDENCIES\">DEPENDENCIES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">File::UserDirs \u2212 find extra media and documents directories<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This document describes File::UserDirs version 0.04.<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use File::UserDirs qw(:all); <br \/> print xdg_desktop_dir; # e.g. \/home\/user\/Desktop<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<h2>INTERFACE <a name=\"INTERFACE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">&#8220;xdg_desktop_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the desktop directory. Unless changed by the user, this is the directory <i>Desktop<\/i> in the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_documents_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the documents directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_download_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the download directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_music_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the music directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_pictures_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the pictures directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_publicshare_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the public share directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_templates_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the templates directory. Unless changed by the user, this is the home directory.<\/p>\n<p style=\"margin-left:11%;\">&#8220;xdg_videos_dir&#8221;<\/p>\n<p style=\"margin-left:17%;\">Returns the videos directory. Unless changed by the user, this is the home directory.<\/p>\n<h2>EXPORTS <a name=\"EXPORTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None by default, but any method can be exported on demand. Also the group &#8220;:all&#8221; is defined which exports all methods.<\/p>\n<h2>DIAGNOSTICS <a name=\"DIAGNOSTICS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">&#8220;&#8221;xdg\u2212user\u2212dir&#8221; failed to start: %s&#8221;<\/p>\n<p style=\"margin-left:17%;\">The executable &#8220;xdg\u2212user\u2212dir&#8221; could not be run, most likely because it was not installed. See &#8221; <small>DEPENDENCIES&#8221;<\/small> .<\/p>\n<h2>CONFIGURATION AND ENVIRONMENT <a name=\"CONFIGURATION AND ENVIRONMENT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The location of the directories can be specified by the user in the file <i>$XDG_CONFIG_HOME\/user\u2212dirs.dirs<\/i>. It is a shell file setting a number of environment variables. To find the exact pathname from Perl, run:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use File::BaseDir qw(config_home); <br \/> print config_home(&#8216;user\u2212dirs.dirs&#8217;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example customised<\/b> <i>user\u2212dirs.dirs<\/i> <br \/> XDG_DESKTOP_DIR=&#8221;$HOME\/Workspace&#8221; <br \/> XDG_DOCUMENTS_DIR=&#8221;$HOME\/Files&#8221; <br \/> XDG_DOWNLOAD_DIR=&#8221;$HOME\/Files\/Downloads&#8221; <br \/> XDG_MUSIC_DIR=&#8221;$HOME\/Files\/Audio&#8221; <br \/> XDG_PICTURES_DIR=&#8221;$HOME\/Files\/Images&#8221; <br \/> XDG_PUBLICSHARE_DIR=&#8221;$HOME\/public_html&#8221; <br \/> XDG_TEMPLATES_DIR=&#8221;$HOME\/Files\/Document templates&#8221; <br \/> XDG_VIDEOS_DIR=&#8221;$HOME\/Files\/Video&#8221;<\/p>\n<h2>DEPENDENCIES <a name=\"DEPENDENCIES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This module requires the executable <i>xdg-user-dir<\/i> from the package &#8220;xdg\u2212user\u2212dirs&#8221;. Source code is available from <http:\/\/cgit.freedesktop.org\/xdg\/xdg\u2212user\u2212dirs\/>.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  File::UserDirs \u2212 find extra media and documents directories <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3662,3007],"class_list":["post-7346","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-fileuserdirs","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7346"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7346\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}