Scroll to navigation

File::HomeDir::Darwin(3) User Contributed Perl Documentation File::HomeDir::Darwin(3)

NAME

File::HomeDir::Darwin - find your home and other directories, on Darwin (OS X)

DESCRIPTION

This module provides Darwin-specific implementations for determining common user directories. In normal usage this module will always be used via File::HomeDir.

Note -- since this module requires Mac::Carbon and Mac::Carbon does not work with 64-bit perls, on such systems, File::HomeDir will fall back to File::HomeDir::Unix instead.

SYNOPSIS

  use File::HomeDir;
  
  # Find directories for the current user
  $home    = File::HomeDir->my_home;      # /Users/mylogin
  $desktop = File::HomeDir->my_desktop;   # /Users/mylogin/Desktop
  $docs    = File::HomeDir->my_documents; # /Users/mylogin/Documents
  $music   = File::HomeDir->my_music;     # /Users/mylogin/Music
  $pics    = File::HomeDir->my_pictures;  # /Users/mylogin/Pictures
  $videos  = File::HomeDir->my_videos;    # /Users/mylogin/Movies
  $data    = File::HomeDir->my_data;      # /Users/mylogin/Library/Application Support

TODO

  • Fallback to Unix if no Mac::Carbon available
  • Test with Mac OS (versions 7, 8, 9)
  • Some better way for users_* ?
2009-03-27 perl v5.10.1