Craig A. Berry wrote:
At 1:08 PM -0500 9/1/07, John E. Malmberg wrote:
Craig A. Berry wrote:
At 12:10 AM -0500 8/31/07, John E. Malmberg wrote:
In lib/Archive/Tar/t/02_methods.t, File::Spec->catfile was being
used where a directory path was needed. There is a significant difference
between catpath and catfile on VMS, and catpath must be used if the
result is intended to be a path.
But you replaced catfile with catdir, not catpath. In any case,
catfile looks right to me as it appears to be generating a file name,
not a directory name.
I meant to type catdir not catpath there.
Either way, it definitely needed to be a file, not a directory, so
I've left it as catfile and fixed the underlying problem instead.
No, it is intended to be a directory with the name indicated by "$$"
The test will not pass with catfile().
catpath() requires a volume component, and catdir does not, so in this
case catdir() appears to be the right choice.
The variable name is $outfile, but it really is expected to contain only
a path, or the call to $tar->extract_file that follows it will fail on
VMS because it it needs a directory.
-John
--- /rsync_root/perl/lib/Archive/Tar/t/02_methods.t Sun May 20 07:56:42 2007
+++ lib/Archive/Tar/t/02_methods.t Thu Aug 30 22:27:44 2007
@@ -732,7 +732,7 @@
)
) {
- my $outfile = File::Spec->catfile( $outpath, $$ );
+ my $outfile = File::Spec->catdir( $outpath, $$ );
ok( $tar->extract_file( $file->full_path, $outfile ),
" Extracted file '$path' to $outfile" );