Skip Menu |
 

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 18846
Status: resolved
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: cpan [...] pjedwards.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.17
Fixed in: (no value)

Attachments


Subject: PATCH for VMS, directories named "0" disappear when using catdir/catfile.
Download (untitled) / with headers
text/plain 1.2k
File::Spec 3.17, Perl 5.87 on VMS This is best demonstrated by: perl "-MFile::Spec" -e "print File::Spec->catfile ('0','i_am_not_a_number','i_am_a_free_man');" VMS returns: [.i_am_not_a_number]i_am_a_free_man UNIX, Linux, Cygwin, A.S. Windows all do not make "0" vanish. The fix is to add "defined" and "&& (ne '')" to the lines: @dirs = grep((defined $_) && ($_ ne ''),@dirs); # 3rd line of sub catdir @files = grep((defined $_) && ($_ ne ''),@files); # 3rd line of sub catfile $rslt = vmsify($rslt.((defined $rslt) && ($rslt ne '') ? '/' : '').unixify($file); # line 14 of sub catfile return '' unless (defined $path) && ($path ne ''); # 2nd line of sub eliminate_macros All in File/Spec/VMS.pm I'm sorry I don't have time to provide a patch for this with some additional test cases, but if you wanted to add: File::Spec->catfile('0','b','c');" [0.b]c File::Spec->catfile('a','0','c');" [a.0]c File::Spec->catfile('a','b','0');" [a.b]0 File::Spec->catfile('0','0','c');" [0.0]c File::Spec->catfile('a','0','0');" [a.0]0 File::Spec->catfile('0','b','0');" [0.b]0 File::Spec->catfile('0','0','0');" [0.0]0 I can confirm that the changes I'm suggesting fix these cases. If you would accept a vms.t file then I'll find time to create one next week. Thanks, Peter (Stig) Edwards
From: cpan [...] pjedwards.co.uk
Download (untitled) / with headers
text/plain 765b
Sorry, correction: File::Spec->catfile('0','b','c');" [0.b]c File::Spec->catfile('a','0','c');" [a.0]c File::Spec->catfile('a','b','0');" [a.b]0 File::Spec->catfile('0','0','c');" [0.0]c File::Spec->catfile('a','0','0');" [a.0]0 File::Spec->catfile('0','b','0');" [0.b]0 File::Spec->catfile('0','0','0');" [0.0]0 Should read: File::Spec->catfile('0','b','c');" [.0.b]c File::Spec->catfile('a','0','c');" [.a.0]c File::Spec->catfile('a','b','0');" [.a.b]0 File::Spec->catfile('0','0','c');" [.0.0]c File::Spec->catfile('a','0','0');" [.a.0]0 File::Spec->catfile('0','b','0');" [.0.b]0 File::Spec->catfile('0','0','0');" [.0.0]0 I tested the patch you posted to perl5.porters and vmsperl, and after the changes above, it looked good. Thanks, Peter (Stig) Edwards
S1:[...PATHTOOLS-3_17]$ perl -v This is perl, v5.8.7 built for VMS_AXP Copyright 1987-2005, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. S1:[...PATHTOOLS-3_17]$ perl makefile.pl Checking if your kit is complete... Looks good Writing Descrip.MMS for Cwd S1:[...PATHTOOLS-3_17]$ mmk CC/DECC /Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj /NOANSI_ALIAS/float=ieee/ieee=denorm/Define=("VERSION=""3.17""","XS_VERSION=""3.17""") /Include=(perl_root:[lib.VMS_AXP.5_8_7.CORE])/NoList CWD.c If F$Search("[.BLIB.ARCH.AUTO.CWD]CWD.OLB").eqs."" Then Library/Object/Create [.BLIB.ARCH.AUTO.CWD]CWD.OLB Library/Object/Replace [.BLIB.ARCH.AUTO.CWD]CWD.OLB CWD.OBJ If F$TrnLNm("PerlShr").eqs."" Then Define/NoLog/User PerlShr Sys$Share:PerlShr.exe Link /NoTrace/NoMap /Shareable=[.BLIB.ARCH.AUTO.CWD]PL_CWD.EXE Cwd.opt/Option,perl_root:[lib.VMS_AXP.5_8_7.CORE]perlshr_attr.opt/Option Running mkbootstrap for Cwd () Copy/NoConfirm Cwd.bs [.blib.arch.auto.Cwd]Cwd.bs %COPY-S-COPIED, S1:[***.CPAN_MODULES.PATHTOOLS-3_17]CWD.BS;1 copied to S1:[***.CPAN_MODULES.PATHTOOLS-3_17.BLIB.ARCH.AUTO.CWD]CWD.BS;1 (0 records) S1:[...PATHTOOLS-3_17]$ mmk test MCR ***.perl.perl-5_8_7_root]perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, '[.blib.lib]', '[.blib.arch]')" t/*.t t/crossplatform.... ok t/cwd.............. ok 2/30 skipped: no symlinks on this platform t/functions........ ok t/rel2abs2rel...... ok t/spec............. ok 12/480 skipped: various reasons t/taint............ ok t/tmpdir........... ok t/win32............ skipped all skipped: this is not win32 All tests successful, 1 test and 14 subtests skipped. Files=8, Tests=587, 35 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU)
Download (untitled) / with headers
text/plain 159b
Thanks, I've applied this in my personal CVS. I'll wait to see whether this causes any failures among the vmsperl/p5p crowd, and if not I'll release. -Ken


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.