File::BaseDir.3pm

Langue: en

Version: 2003-09-04 (mandriva - 22/10/07)

Section: 3 (Bibliothèques de fonctions)

NAME

File::BaseDir - use the freedesktop basedir spec

SYNOPSIS

         use File::BaseDir qw/xdg_data_files/;
         for ( xdg_data_files('mime/globs') ) {
                 # do something
         }
 
 

DESCRIPTION

This module can be used to find directories and files as specified by the XDG Base Directory Specification. It takes care of defaults and uses File::Spec to make the output platform specific.

This module forked from File::MimeInfo.

For this module the XDG basedir specification 0.6 was used.

EXPORT

None by default, but all methods can be exported on demand.

METHODS

"new()"
Simple constructor to allow Object Oriented use of this module.
"xdg_data_home"
Returns either $ENV{XDG_DATA_HOME} or it's default value.
"xdg_data_dirs"
Returns either $ENV{XDG_DATA_DIRS} or it's default value.
"xdg_data_files($file)"
Searches for $file in all "XDG_DATA_DIRS" and only returns existing readable files.

The file path can also be given as a list.

"xdg_config_home"
Returns either $ENV{XDG_CONFIG_HOME} or it's default value.
"xdg_config_dirs"
Returns either $ENV{XDG_CONFIG_DIRS} or it's default value.
"xdg_config_files($file)"
Searches for $file in all "XDG_CONFIG_DIRS" and only returns existing readable files.

The file path can also be given as a list.

"xdg_cache_home"
Returns either $ENV{XDG_CACHE_HOME} or it's default value.

BUGS

Please mail the author if you encounter any bugs.

AUTHOR

Jaap Karssenberg || Pardus [Larus] <pardus@cpan.org>

Copyright (c) 2003 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

<http://www.freedesktop.org/standards/basedir-spec/>