On Sun, Sep 17, 2000 at 05:36:56AM -0000, Perl6 RFC Librarian wrote:
> unlink "/local/etc/script.conf"; # non-portable
> unlink "file:///local/etc/script.conf"; # portable
'/local/etc/script.conf' is very unlikely to exist or be a sensible
filename on Windows or MacOS (or Unix. Shouldn't that be
/usr/local?).
The suggestion about stripping C:\ off the filepath doesn't help much.
Windows programs like to put things in the root directory. (C:\PERL
anyone?). Unix prefers many different locations, and severely
restricts usage of /.
MacOS and Windows paths have a chance of being portable, since both
don't mind putting things in root positions, by mapping C: to the main
MacOS partition.
What about D:? "file://C|/foo" and "file://D|/foo". On Windows
they're seperate. On Unix they're... what? On MacOS, C: could be the
main partition and D: a secondary one (if it exists, which is
relatively uncommon), but which one? And as the disposition of MacOS
partitions varies wildly, it will more than likely produce extremely
surprising results.
AUUGH!! And we haven't even gotten into VMS and OS/2 yet. Oh, how
about the Amiga? BeOS? OS390?
Solving the file seperator problem is one thing. Calling it
"portable" is huge stretch.
Now, where the file: url *does* win is relative files.
open 'file:some/directory/file';
All the noise I was talking about above goes away.. but there's more
trouble waiting. Case-sensitive vs insensitive filesystems, maximum
filename length, maximum path length, restrictions on the filename,
restrictions on the suffix (ie. 8.3 DOS).
Maybe we should just go back to paper.
--
Michael G Schwern http://www.pobox.com/~schwern/ [EMAIL PROTECTED]
Just Another Stupid Consultant Perl6 Kwalitee Ashuranse
<mendel> ScHWeRnsChweRN sChWErN SchweRN SCHWErNSChwERnsCHwERN
sChWErn ScHWeRn schweRn sCHWErN schWeRn
scHWeRN SchWeRN scHWErn SchwErn scHWErn ScHweRN
sChwern scHWerN scHWeRn scHWerN ScHwerN
SChWeRN scHWeRn SchwERNschwERn SCHwern sCHWErN SCHWErN
sChWeRn