Skip Menu |

This queue is for tickets about the File-Copy-Recursive CPAN distribution.

Report information
The Basics
Id: 117241
Status: resolved
Priority: 0/
Queue: File-Copy-Recursive

People
Owner: Nobody in particular
Requestors: Gordon.Weekly [...] mathworks.com
Cc:
AdminCc:

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



Subject: dircopy doesn't copy contents of non-writeable directories
Date: Fri, 26 Aug 2016 20:05:14 +0000
To: "bug-File-Copy-Recursive [...] rt.cpan.org" <bug-File-Copy-Recursive [...] rt.cpan.org>
From: Gordon Weekly <Gordon.Weekly [...] mathworks.com>
Hi, It seems version 0.38 does not copy contents of non-writeable directories. Distribution name and version: File-Copy-Recursive-0.38 Perl version: v5.20.2 built for x86_64-linux-thread-multi uname -a: Linux machine 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux Reproduction steps: % cd /tmp % mkdir src % mkdir src/top % mkdir src/top/sub1 % touch src/top/sub1/file1.1 % echo hello-1.2 > src/top/sub1/file1.2 % mkdir src/top/sub2 % touch src/top/sub2/file2.1 % echo hello-2.2 > src/top/sub2/file2.2 % chmod -w src/top/sub2 % perl -MFile::Copy::Recursive'(dircopy)' -de0 DB<1> x dircopy( '/tmp/src', '/tmp/dest' ) Note that /tmp/dest/top/sub2 is an empty directory - ought to have 2 files Patch: --- Recursive.pm +++ /tmp/Recursive.pm @@ -218,6 +218,6 @@ $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0'; mkdir($end,$DirPerms) or return if !-d $end; - chmod scalar((stat($str))[2]), $end if $KeepMode; if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) { return ($filen,$dirn,$level) if wantarray; return $filen; @@ -268,4 +268,5 @@ } } + chmod scalar((stat($str))[2]), $end if $KeepMode; 1; }; Note: You may want to also deal with the early returns (eg: line 222) as they may want the chmod's too. Thank you, -Gordon Weekly
thanks! will rectify ASAP :) On Fri Aug 26 16:05:30 2016, Gordon.Weekly@mathworks.com wrote: Show quoted text
> Hi, > It seems version 0.38 does not copy contents of non-writeable > directories. > > Distribution name and version: File-Copy-Recursive-0.38 > Perl version: v5.20.2 built for x86_64-linux-thread-multi > uname -a: > Linux machine 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux > Reproduction steps: > % cd /tmp > % mkdir src > % mkdir src/top > % mkdir src/top/sub1 > % touch src/top/sub1/file1.1 > % echo hello-1.2 > src/top/sub1/file1.2 > % mkdir src/top/sub2 > % touch src/top/sub2/file2.1 > % echo hello-2.2 > src/top/sub2/file2.2 > % chmod -w src/top/sub2 > % perl -MFile::Copy::Recursive'(dircopy)' -de0 > DB<1> x dircopy( '/tmp/src', '/tmp/dest' ) > Note that /tmp/dest/top/sub2 is an empty directory - ought to have 2 > files > > Patch: > --- Recursive.pm > +++ /tmp/Recursive.pm > @@ -218,6 +218,6 @@ > $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0'; > mkdir($end,$DirPerms) or return if !-d $end; > - chmod scalar((stat($str))[2]), $end if $KeepMode; > if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) > { > return ($filen,$dirn,$level) if wantarray; > return $filen; > @@ -268,4 +268,5 @@ > } > } > + chmod scalar((stat($str))[2]), $end if $KeepMode; > 1; > }; > > Note: You may want to also deal with the early returns (eg: line 222) > as they may want the chmod's too. > > Thank you, > -Gordon Weekly
Seems this was fixed in 0.39 but in 0.40 I am adding a test and this change because it does seem logical :) thanks again!
On Tue Jan 16 13:23:16 2018, DMUEY wrote: Show quoted text
> Seems this was fixed in 0.39 but in 0.40 I am adding a test and this > change because it does seem logical :) thanks again!
Should be resolved by 0.40 just uploaded to CPAN, thanks!