develooper Front page | perl.perl6.language.io | Postings from August 2000

Re: RFC 100 (v1) Embed full URI support into Perl

Thread Previous
From:
Nathan Wiger
Date:
August 15, 2000 09:54
Subject:
Re: RFC 100 (v1) Embed full URI support into Perl
Message ID:
399975A6.3670C090@west.sun.com
Chaim Frenkel wrote:
> 
> >>>>> "PRL" == Perl6 RFC Librarian <perl6-rfc@perl.org> writes:
> 
> PRL>    $fo = open "C:\Windows\System";        # non-portable
> PRL>    $fo = open "file://C|/Windows/System"; # portable
> 
> In what way is the second example portable? I don't think it will
> do anything useful on any of my *nix boxes.

This is a big problem, you're right. I don't know of any easy way to
work around Windoze's brain-dead drive letters. There's definitely no
quick fixes.

Note that Macs vs Unix don't have a problem:

   # /docs/personal on Unix
   # :docs:personal on MacOS
   $fo = open "file:///docs/personal";

The best fix I see is to accept technically incorrect URIs (missing |
after drive letter), then change the drive letter to the correct root
notation on the platform:

   open "file://c/docs/personal";  # not "C|"

   # Unix = /docs/personal
   # Mac  = :docs:personal
   # Win  = c:\docs\personal

That's the easiest solution I can think of, and seems to make sense.

-Nate

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About