develooper Front page | perl.perl5.porters | Postings from September 2003

File::Spec VMS question

Thread Next
From:
Ken Williams
Date:
September 14, 2003 15:13
Subject:
File::Spec VMS question
Message ID:
76E7F4B3-E700-11D7-A3E5-003065F6D85A@mathforum.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I've got a fairly fundamental question to ask about File::Spec on VMS, 
and the answer will help me a great deal.

Should abs2rel('[t1.t2.t3]file','[t1.t2]') return '[.t3]file', or 
'[t3]file'?

Also, what exactly do the two alternatives mean?

I ask because my intuition tells me that the following patch should be 
made in rel2abs():

@@ -431,6 +431,5 @@
      # @basechunks now contains the directories to climb out of,
      # @pathchunks now has the directories to descend in to.
- -    $path_directories = '-.' x @basechunks . join( '.', @pathchunks ) ;
- -    $path_directories =~ s{\.\Z(?!\n)}{} ;
+    $path_directories = join '.', ('-' x @basechunks, @pathchunks) ;
      return $self->canonpath( $self->catpath( '', $path_directories, 
$path_file ) ) ;
  }

If I make this change, then the t/crossplatform.t test starts working 
(yay!) (see File::Spec 0.85_02 on CPAN), but a couple of the exact same 
kinds of tests in t/Spec.t start failing.  Which is right?

  -Ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iD8DBQE/ZOe9grvMBLfvlHYRAqCtAJ9koDFZChVATuB0gF8C8lXyR07z3gCgujgX
imbyJ8wttEFain7A0JdaEcU=
=EU6V
-----END PGP SIGNATURE-----


Thread Next


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