Mac::SystemDirectory - Locate Mac OS X Standard System Directories
version 0.14
use Mac::SystemDirectory qw[:all]; $path = FindDirectory(NSDocumentDirectory); $path = HomeDirectory(); $path = TemporaryDirectory();
Locate Mac OS X Standard System Directories
Creates a list of path strings for the specified directories in the specified domains. The list is in the order in which you should search the directories.
Usage
$path = FindDirectory(NSApplicationDirectory); @paths = FindDirectory(NSApplicationDirectory);
Arguments
"Directory" constant.
"DomainMask" constant. Defaults to NSUserDomainMask.
NSUserDomainMask
Returns
When called in scalar context this function returns the first matching directory. In list context it returns all matching directories. If no directories are found, undef is returned in a scalar context and an empty list in a list context.
Path to the current user's home directory.
$path = HomeDirectory();
A string containing the path of the current user's home directory.
Path to the current user's temporary directory.
$path = TemporaryDirectory();
A string containing the path of the temporary directory for the current user. If no such directory is currently available, returns undef.
Bitmask constants that identify the file-system domain (User, System, Local, Network) or all domains.
The user's home directory-the place to install user's personal items (~).
Available in Mac OS X v10.0 and later.
Local to the current machine-the place to install items available to everyone on this machine.
Publicly available location in the local area network-the place to install items available on the network (/Network).
Provided by Apple - can't be modified (/System).
All domains. Includes all of the above and future items.
Constants that identify the name or type of directory (for example, Library, Documents, or Applications).
Supported applications (/Applications).
Unsupported applications and demonstration versions.
Developer applications (/Developer/Applications).
System and network administration applications.
Various user-visible documentation, support, and configuration files (/Library).
Developer resources (/Developer). Deprecated: Beginning with Xcode 3.0, developer tools can be installed in any location.
User home directories (/Users).
Documentation.
Document directory.
Available in Mac OS X v10.2 and later.
Location of core services (System/Library/CoreServices).
Available in Mac OS X v10.4 and later.
Location of user's autosaved documents Documents/Autosaved
Available in Mac OS X v10.6 and later.
Location of user's desktop directory.
Location of discardable cache files (Library/Caches).
Location of application support files (Library/Application Support).
Location of the user's downloads directory.
Available in Mac OS X v10.5 and later.
Location of Input Methods (Library/Input Methods)
Location of user's Movies directory (~/Movies)
Location of user's Movies directory (~/Music)
Location of user's Movies directory (~/Pictures)
Location of system's PPDs directory (Library/Printers/PPDs)
Location of user's Public sharing directory (~/Public)
Location of the PreferencePanes directory for use with System Preferences (Library/PreferencePanes)
For use with NSFileManager method URLForDirectory:inDomain:appropriateForURL:create:error:
All directories where applications can occur.
All directories where resources can occur.
None by default. Functions and constants can either be imported individually or in sets grouped by tag names. The tag names are:
:all
:DomainMask
:Directory
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/LowLevelFileMgmt/Articles/StandardDirectories.html http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html
Bugs may be submitted through the RT bug tracker (or bug-Mac-SystemDirectory@rt.cpan.org).
Christian Hansen <chansen@cpan.org>
Karen Etheridge <ether@cpan.org>
This software is copyright (c) 2009 by Christian Hansen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Mac::SystemDirectory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::SystemDirectory
CPAN shell
perl -MCPAN -e shell install Mac::SystemDirectory
For more information on module installation, please visit the detailed CPAN module installation guide.