brian d foy > Mac-Path-Util > Mac::Path::Util

Download:
Mac-Path-Util-0.26.tar.gz

Dependencies

Annotate this POD (1)

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.26   Source  

NAME ^

Mac::Path::Util - convert between darwin and Mac paths

SYNOPSIS ^

        use Mac::Path::Util;

        my $path     = Mac::Path::Util->new( "/Users/foo/file.txt" );
        my $mac_path = $path->mac_path;

DESCRIPTION ^

THIS IS ALPHA SOFTWARE. SOME THINGS ARE NOT FINISHED.

Convert between darwin (unix) and Mac file paths.

This is not as simple as changing the directory separator. The Mac path has the volume name in it, whereas the darwin path leaves off the startup volume name because it is mounted as /. Mac::Path::Util can optionally use Mac::Carbon to determine the real startup volume name (off by default) if you have installed Mac::Carbon. You can use this module on other platforms too. Once the module has looked up the volume name, it caches it. If you want to reset the cache, use the clear_startup() method.

Colons ( ":" ) in the darwin path become / in the Mac path, and forward slashes in the Mac path become colons in the darwin path.

Mac paths do not have a leading directory separator for absolute paths.

Normally, Mac paths that end in a directory name have a trailing colon, but this module cannot necessarily verify that since you may want to convert paths.

Methods

new( PATH [, HASH ] )

The optional anonymous hash can have these values:

        type      DARWIN or MACOS (explicitly state which sort of path
                 with these symbolic constants)
        startup   the name of the startup volume (if not defined, tries to use
                 the startup volume on the local machine)

Accessor methods

type
path
volume
startup
mac_path
darwin_path

Setter methods

use_carbon( [ TRUE | FALSE ] )

Mac::Path::Util will try to use Mac::Carbon to determine the real startup volume name if you pass this method a true value and you have Mac::Carbon installed. Otherwise it will use a default startup volume name.

clear_startup

Clear the cached startup volume name. The next lookup will reset the cache.

SOURCE AVAILABILITY ^

This source is part of a SourceForge project which always has the latest sources in SVN, as well as all of the previous releases.

        http://sourceforge.net/projects/brian-d-foy/

If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.

AUTHOR ^

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (c) 2002-2008 brian d foy. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: