Charles Bailey wrote:
> | Rhetorical question: If I am on a Mac and want to convert a
> | C:\Windows\File\Spec.txt to a C:[VMS.FILE]SPEC.TXT how do I do that with
> | File::Spec? Is it even possible?
>
> It should be possible, though there isn't a nicely packaged way to do
> the conversion (that's probably easy, too). Something like (untested)
>
> my($dev,$dir,$fil) = File::Spec::Mac->splitpath($mac_name);
> my @dirs = File::Spec::Mac->splitdirs($dir);
> my $vms_name = File::Spec::VMS->catpath($dev,
> File::Spec::VMS->catdirs(@dirs),
> $fil);
>
> should do the trick.
Thanks. Re: "nicely packaged way to do the conversion" I'd say consider the
example set by graphics file format converters. Recall netpbm and the need
to come up with a new pnm graphics file format just to reduce the O(N**2)
problem of handling N file formats and interconversions to an O(2*N) problem?
I am not sure what the ultimate meta file format ought to be (analogous to pnm
graphics files). Do note that there is currently no File::Spec::Acorn nor
::Amiga nor ::MVS, etc. Although I understand the need for a separate ::DOS
one I am not even sure why there are separate ::OS2 and ::Win32 ones (but
that's OK I probably do not want to know :-)
Peter Prymmer