At 4/18/2002 2:40 AM, Thomas Wegner wrote:
> At 11:49 Uhr -0700 17.04.2002, David Iberri wrote:
>> Bill Becker wrote:
>> 
>>> What would be the best way to determine this programmatically ???
>> 
>> The File::Spec module should lead you in the right direction.
>
> Noooooooo! Don't abuse File::Spec.

Ack, I stand corrected.

In an effort to bring peace back to the universe, I announce that I don't
abuse File::Spec personally -- I was merely trying to give Bill Becker a
decent answer to his question. Can't win 'em all :-)

Cheers,
David Iberri

> For me, running MacPerl 5.6.1, the following example script
> 
> use File::Spec;
> 
> $pathsep = File::Spec->catdir('');
> print "pathsep = $pathsep \n";
> 
> yields:
> 
> pathsep = MacintoshHD:
> 
> which is a volume name, i.e. an absolute path.
> 
> Why? With MacPerl 5.6.1, catdir() has been changed to return relative paths by
> default, unless the first argument is an empty string (see File::Spec::Mac
> version 1.3 for details). Although your statement was true with earlier
> versions of File::Spec::Mac (and MacPerl 5.2.0r4), it was true only by
> accident. catdir() was never designed to give you the path separator, not on
> Mac OS, not on Unix, not on VMS et al. In your example, the resulting ':' on
> Mac OS was meant to be the current directory, and the resulting '/' on Unix
> was/is meant to be the root directory.
> 
> Please don't do that at home, boys and girls.
> 
> 
> Best regards,
> 
> --Thomas
> 
> 
> 
> 
> 
> 
> 
> 
> 

Reply via email to