Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    File::HomeDir 0.99

    Download button

    No screenshots available
    Downloads: 176  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Adam Kennedy | More programs
    Perl Artistic License / FREE
    April 27th, 2012, 04:45 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    File::HomeDir description

    Find your home and other directories on any platform

    File::HomeDir is a Perl module for locating the directories that are "owned" by a user (typicaly your user) and to solve the various issues that arise trying to find them consistently across a wide variety of platforms.

    The end result is a single API that can find your resources on any platform, making it relatively trivial to create Perl software that works elegantly and correctly no matter where you run it.

    This module provides two main interfaces.

    The first is a modern File::Spec-style interface with a consistent OO API and different implementation modules to support various platforms. You are strongly recommended to use this interface.

    The second interface is for legacy support of the original 0.07 interface that exported a home() function by default and tied the %~ variable.

    It is generally not recommended that you use this interface, but due to back-compatibility reasons they will remain supported until at least 2010.

    The %~ interface has been deprecated. Documentation was removed in 2009, Unit test were removed in 2011, usage will issue warnings from 2013, and the interface will be removed entirely in 2015 (in line with the general Perl toolchain convention of a 10 year support period for legacy APIs that are potentially or actually in common use).

    SYNOPSIS

     use File::HomeDir;
     
     # Modern Interface (Current User)
     $home = File::HomeDir->my_home;
     $desktop = File::HomeDir->my_desktop;
     $docs = File::HomeDir->my_documents;
     $music = File::HomeDir->my_music;
     $pics = File::HomeDir->my_pictures;
     $videos = File::HomeDir->my_videos;
     $data = File::HomeDir->my_data;
     $dist = File::HomeDir->my_dist_data('File-HomeDir');
     $dist = File::HomeDir->my_dist_config('File-HomeDir');
     
     # Modern Interface (Other Users)
     $home = File::HomeDir->users_home('foo');
     $desktop = File::HomeDir->users_desktop('foo');
     $docs = File::HomeDir->users_documents('foo');
     $music = File::HomeDir->users_music('foo');
     $pics = File::HomeDir->users_pictures('foo');
     $video = File::HomeDir->users_videos('foo');
     $data = File::HomeDir->users_data('foo');
     
     # Legacy Interfaces
     print "My dir is ", home(), " and root's is ", home('root'), "\n";
     print "My dir is $~{''} and root's is $~{root}\n";
     # These both print the same thing, something like:
     # "My dir is /home/user/mojo and root's is /"



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    locate home | locate directories | Perl module | Perl | home | locator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM