Skip Menu |

This queue is for tickets about the ppt CPAN distribution.

Report information
The Basics
Id: 7403
Status: resolved
Priority: 0/
Queue: ppt

People
Owner: Nobody in particular
Requestors: ccarvell [...] nmdp.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.14
Fixed in: (no value)



Subject: Bug in ":" pathing statment of ls module on win32 systems
The system is winxp Sp1, perl 5.8.4. When you do a ls to a c:/ or c:/dir1, it recieves the file lists ok, but the traversing of dir structure not working correctly. It appears to insert a unneeded ":". Code I used to fire it off: use strict; my $file; my $return; my $Val; $file = "c:/Perl/bin/perl.exe c:/Perl/bin/ls.pl -ltrR C:/Windows"; open(PS_F, "$file|"); while (<PS_F>) { $Val = $Val . $_; } close(PS_F); print "RES: $Val\n"; ================================================================== Results of the Error: pls: can't access 'C:/Windows: /twain_32': No such file or directory C:/Windows: /twain_32: total 0 If you notice the extra ":" after windows and before the /twain32 directory, this is not needed. I will see what I can do to fix it. Thanks, Cade
From: Alexandr Ciornii <alexchorny [...] gmail.com>
On Aug 18 22:35:18 2004, Cade wrote: Show quoted text
> When you do a ls to a c:/ or c:/dir1, it recieves the file lists ok, > but the traversing of dir structure not working correctly. It appears > to insert a unneeded ":".
Patch to make ls work and use File::Spec. ------- Alexandr Ciornii, http://chorny.net
*** ls.orig Thu Aug 5 17:17:43 2004 --- ls Wed Jul 19 00:48:16 2006 *************** *** 6,11 **** --- 6,12 ---- # ------ use/require pragmas use File::stat; use Getopt::Std; + use File::Spec; #to remove $PathSep #use strict; # ------ partial inline of Stat::lsMode v0.50 code *************** *** 64,72 **** my $Maxlen = 1; # longest string we've seen my $Now = time; # time we were invoked my %Options = (); # option/flag arguments - my $PathSep = "/"; # path separator - # (someone might want to patch this via - # File::Spec...) my $SixMonths = # long listing time if < 6 months, else year 60*60*24*(365/2); my $VERSION = '0.70'; # because we're V7-compatible :) --- 65,70 ---- *************** *** 98,104 **** my %Attributes = (); # entry/attributes hash my @Entries = (); # entries in original order my $Name = ""; # entry name - if (!opendir(DH, $_[0]) || exists($Options{'d'})) { if (-e $_[0]) { closedir(DH) if (defined(DH)); --- 96,101 ---- *************** *** 114,120 **** next if (!exists($Options->{'a'}) && $Name =~ m/^\./o); push(@Entries, $Name); ! $Attributes{$Name} = stat("$_[0]$PathSep$Name"); } closedir(DH); --- 111,117 ---- next if (!exists($Options->{'a'}) && $Name =~ m/^\./o); push(@Entries, $Name); ! $Attributes{$Name} = stat(File::Spec->catfile($_[0],$Name)); } closedir(DH); *************** *** 358,367 **** next if ($Entry eq "." || $Entry eq ".."); if (defined($Attributes->{$Entry}) && $Attributes->{$Entry}->mode & 0040000) { ! $Path = "$Name: $PathSep$Entry"; ! if ($Name =~ m#$PathSep$#) { ! $Path = "$Name: $Entry"; ! } @Dirs = DirEntries(\%Options, $Path); List($Path, \%Options, 0, @Dirs); } --- 355,361 ---- next if ($Entry eq "." || $Entry eq ".."); if (defined($Attributes->{$Entry}) && $Attributes->{$Entry}->mode & 0040000) { ! $Path = File::Spec->canonpath(File::Spec->catdir($Name,$Entry)); @Dirs = DirEntries(\%Options, $Path); List($Path, \%Options, 0, @Dirs); }
This is fixed in the PerlPowerTools repo, the revitalized version of this project. http://blogs.perl.org/users/brian_d_foy/2014/09/revitalizing-the-perl-power-tools.html