home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl_ste.zip / auto / URI / URL / file / vms_path.al < prev   
Text File  |  1997-11-28  |  1KB  |  40 lines

  1. # NOTE: Derived from ./blib/lib/URI/URL/file.pm.  Changes made here will be lost.
  2. package URI::URL::file;
  3.  
  4. sub vms_path
  5. {
  6.     # ????? Can some VMS people please redo this function ??????
  7.  
  8.     # This is implemented based on what RFC1738 (sec 3.10) says in the
  9.     # VMS file example:
  10.     #
  11.     #  DISK$USER:[MY.NOTES]NOTE123456.TXT
  12.     #
  13.     #      that might become
  14.     #
  15.     #  file:/disk$user/my/notes/note12345.txt
  16.     #
  17.     # BEWARE: I don't have a VMS machine myself so this is pure guesswork!!!
  18.  
  19.     my $self = shift;
  20.     my @p = $self->path_components;
  21.     my $abs = 0;
  22.     if (@p && $p[0] eq '') {
  23.     shift @p;
  24.     $abs = 1;
  25.     }
  26.     # First I assume there must be a dollar in a disk spesification
  27.     my $p = '';
  28.     $p = uc(shift(@p)) . ":"  if @p && $p[0] =~ /\$/;
  29.     my $file = pop(@p);
  30.     $p .= "[" . join(".", map{uc($_)} @p) . "]" if @p;
  31.     $p .= uc $file;
  32.     # XXX: How is an absolute path different from a relative one??
  33.     $p =~ s/\[/[./ unless $abs;
  34.     # XXX: How is a directory denoted??
  35.     $p;
  36. }
  37.  
  38. 1;
  39. 1;
  40.