Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 16613
Status: open
Left: 0 min
Priority: 0/0
Queue: Path-Class

Owner: Nobody
Requestors: CDOLAN <chris+rt [...] chrisdolan.net>
Cc:
AdminCc:

Severity: Normal
Broken in: 0.15
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Mon Dec 19 14:17:07 2005 CLOTHO - Ticket created  
Subject: Classic Mac absolute paths come out as relative in Unix
[text/plain 433b]
When converting a Classic Mac path to Unix (i.e. OS 9 to OS X), the absoluteness of the path is lost. For example:

use Path::Class qw(foreign_dir);
my $dir = foreign_dir("Mac", "Macintosh HD:Users:chris:");
print $dir->as_foreign("Unix"),"\n";

Actual result:
Users/chris

Expected result:
/Users/chris

This is with
OS X 10.4.3
Perl 5.8.6 (Apple's build)
Path::Class 0.15
File::Spec 3.14
Mac::Files 1.09

#   Tue Dec 27 21:31:16 2005 KWILLIAMS - Correspondence added  
[text/plain 877b]
Thanks for the report. I can indeed reproduce this, but I'm unsure of the best solution. The
root cause is that MacOS, unlike some other multi-volume systems (notably win32), has no
notion of a per-volume "current working directory". So while C:foo\bar on win32 might refer
to C:\baz\foo\bar if \baz is the CWD for C:, there's no analogous situation on MacOS, and
thus File::Spec's splitpath() and splitdir() don't give MacOS's paths a leading empty string like
they do on other platforms.

I think the correct fix for this would probably be to change File::Spec, but I'm not completely
sure.

Also, note that the most desirable behavior when converting from MacOS paths to OS X paths
(probably a pretty common situation) would be to convert "MacHD:foo:bar" to "/Volumes/
MacHD/foo/bar", not just "/foo/bar". That would require some additional machinery too.

-Ken

#   Tue Dec 27 21:31:17 2005 KWILLIAMS - Status changed from 'new' to 'open'  
#   Sun Dec 24 21:30:46 2006 KWILLIAMS - Correspondence added  
[text/plain 116b]
Still don't have a great solution for this one, but I've added some TODO tests for it to the latest
release.

-Ken