Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: janseidl [...] volny.cz
Cc:
AdminCc:

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



Example is in attachment, but problem is: I rcopy some dir structure to other_dir, other_dir deleted and rcopy some data to other-other_dir, rcopy create empty other_dir...
Subject: rcopy_bug.t
use strict; use warnings; our $VERSION = '0.0.1'; use File::Spec::Functions qw(catfile); use FindBin; use Test::More tests => 3; use File::Temp; use File::Path qw(remove_tree); use lib catfile($FindBin::Bin, '../../../lib'); use_ok('File::Copy::Recursive'); my $tmp = File::Temp->newdir(); my $a = catfile($tmp, 'a'); mkdir $a; my $b = catfile($tmp, 'b'); my $c = catfile($tmp, 'c'); open my $FILE,'>', "$a/test"; close $FILE; File::Copy::Recursive::rcopy($a, $b); remove_tree($b); ok(!-d $b, 'b is deleted'); note(qx("ls -al $tmp")); File::Copy::Recursive::rcopy($a, $c); ok(!-d $b, 'b is must be deleted too'); note(qx("ls -al $tmp"));
On Fri Mar 27 09:18:10 2015, SEIDLJAN wrote: Show quoted text
> Example is in attachment, but problem is: > > I rcopy some dir structure to other_dir, other_dir deleted and rcopy > some data to other-other_dir, rcopy create empty other_dir...
It works for me as I'd expect it to. What problem are you seeing specifically?
Subject: Re: [rt.cpan.org #103141]
Date: Fri, 27 Mar 2015 15:07:45 +0100
To: bug-File-Copy-Recursive [...] rt.cpan.org
From: Jan Seidl <janseidl [...] volny.cz>
My minimal test which I send failed: 1..3 ok 1 - use File::Copy::Recursive; ok 2 - b is deleted # total 12 # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a not ok 3 - b is must be deleted too # Failed test 'b is must be deleted too' # at t.t line 1. # total 12 # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 b # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 c # Looks like you failed 1 test of 3 on centos7 perl 5.16 works fine, but on windows (active states perl v5.16.3) failed... Sorry, I don't write this... 2015-03-27 14:31 GMT+01:00 Daniel Muey via RT < bug-File-Copy-Recursive@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=103141 > > > On Fri Mar 27 09:18:10 2015, SEIDLJAN wrote:
> > Example is in attachment, but problem is: > > > > I rcopy some dir structure to other_dir, other_dir deleted and rcopy > > some data to other-other_dir, rcopy create empty other_dir...
> > It works for me as I'd expect it to. What problem are you seeing > specifically? > > >
On Fri Mar 27 10:08:16 2015, janseidl@volny.cz wrote: Show quoted text
> My minimal test which I send failed: > > 1..3 > ok 1 - use File::Copy::Recursive; > ok 2 - b is deleted > # total 12 > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a > not ok 3 - b is must be deleted too > # Failed test 'b is must be deleted too' > # at t.t line 1. > # total 12 > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 b > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 c > # Looks like you failed 1 test of 3 > > on centos7 perl 5.16 works fine, but on windows (active states perl > v5.16.3) failed... Sorry, I don't write this...
no worries :) It looks like the problem is that the call to File::Path::remove_tree($b) is not removing the 'b' directory, is that correct?
Subject: Re: [rt.cpan.org #103141]
Date: Fri, 27 Mar 2015 16:09:00 +0100
To: bug-File-Copy-Recursive [...] rt.cpan.org
From: Jan Seidl <janseidl [...] volny.cz>
remove_tree delete $b, but after next call rcopy($a,$c) $b exist again... 2015-03-27 15:15 GMT+01:00 Daniel Muey via RT < bug-File-Copy-Recursive@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=103141 > > > On Fri Mar 27 10:08:16 2015, janseidl@volny.cz wrote:
> > My minimal test which I send failed: > > > > 1..3 > > ok 1 - use File::Copy::Recursive; > > ok 2 - b is deleted > > # total 12 > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a > > not ok 3 - b is must be deleted too > > # Failed test 'b is must be deleted too' > > # at t.t line 1. > > # total 12 > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 . > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 .. > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 a > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 b > > # drwxr-xr-x 1 seidl Domain Users 0 Mar 27 15:04 c > > # Looks like you failed 1 test of 3 > > > > on centos7 perl 5.16 works fine, but on windows (active states perl > > v5.16.3) failed... Sorry, I don't write this...
> > no worries :) It looks like the problem is that the call to > File::Path::remove_tree($b) is not removing the 'b' directory, is that > correct? >
On Fri Mar 27 11:09:35 2015, janseidl@volny.cz wrote: Show quoted text
> remove_tree delete $b, but after next call rcopy($a,$c) $b exist again...
Odd, as soon as I can I'll send you a version to run and send back the output that will help me debug it a bit more. Thanks
On Fri Mar 27 11:14:38 2015, DMUEY wrote: Show quoted text
> On Fri Mar 27 11:09:35 2015, janseidl@volny.cz wrote:
> > remove_tree delete $b, but after next call rcopy($a,$c) $b exist > > again...
> > Odd, as soon as I can I'll send you a version to run and send back the > output that will help me debug it a bit more. Thanks
Which I need to do because I don't have windows :) Sorry!
Can you run this on your windows machine and post the output back here? thanks! use strict; use warnings; use File::Spec::Functions qw(catfile); use FindBin; use Test::More tests => 2; use File::Temp; use File::Path qw(remove_tree); use File::Copy::Recursive; diag("$] $^O"); my $tmp = File::Temp->newdir(); my $a1 = catfile($tmp, 'a1'); mkdir $a1; my $b1 = catfile($tmp, 'b1'); my $c1 = catfile($tmp, 'c1'); open my $FILE,'>', "$a1/test"; print {$FILE} "oh hai"; close $FILE; _debug_dir("After setup"); File::Copy::Recursive::rcopy($a1, $b1); _debug_dir("After rcopy(a1,b1)"); remove_tree($b1); _debug_dir("After remove_tree(b1)"); ok(!-d $b1, 'b is deleted'); File::Copy::Recursive::rcopy($a1, $c1); _debug_dir("After rcopy(a1,b1)"); ok(!-d $b1, 'b is must be deleted too'); sub _debug_dir { diag("DEBUG: " . shift()); diag(" TMP: -$tmp-"); diag(`ls -l $tmp`); diag(" A1 : -$a1-"); diag(`ls -l $a1`); diag(" B1 : -$b1-"); diag(`ls -l $b1`); diag(" C1 : -$c1-"); diag(`ls -l $c1`); diag("/DEBUG"); diag(""); }
Subject: Re: [rt.cpan.org #103141]
Date: Tue, 26 Jan 2016 10:48:21 +0100
To: bug-File-Copy-Recursive [...] rt.cpan.org
From: Jan Seidl <janseidl [...] volny.cz>
Show quoted text
> perl test.pl
1..2 # 5.016003 MSWin32 # DEBUG: After setup # TMP: -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg- # total 0 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 a1 # A1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\a1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # B1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1- ls: cannot access C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1: No such file or directory # C1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1- ls: cannot access C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1: No such file or directory # /DEBUG # # DEBUG: After rcopy(a1,b1) # TMP: -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg- # total 0 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 a1 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 b1 # A1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\a1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # B1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # C1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1- ls: cannot access C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1: No such file or directory # /DEBUG # # DEBUG: After remove_tree(b1) # TMP: -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg- # total 0 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 a1 # A1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\a1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # B1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1- ls: cannot access C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1: No such file or directory # C1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1- ls: cannot access C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1: No such file or directory # /DEBUG # ok 1 - b is deleted # DEBUG: After rcopy(a1,b1) # TMP: -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg- # total 0 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 a1 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 b1 # drwxr-xr-x 1 seidl Domain Users 0 Jan 26 10:44 c1 # A1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\a1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # B1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\b1- # total 0 # C1 : -C:\Users\seidl\AppData\Local\Temp\OdbxgrRJOg\c1- # total 1 # -rw-r--r-- 1 seidl Domain Users 6 Jan 26 10:44 test # /DEBUG # not ok 2 - b is must be deleted too # Failed test 'b is must be deleted too' # at test.pl line 36. # Looks like you failed 1 test of 2.
thanks! That is really odd for sure. Without a windows box to add debugging output to rcopy() and narrow down at what point it reappears there isn't much I can do ATM. Could you do that? Its almost as if something in rcopy() is trigging a rollback of the file system … What type of file system is that happening on? Does it happen on other file system types? For anyone watching from home, my test script needs this patch applied: File::Copy::Recursive::rcopy($a1, $c1); - _debug_dir("After rcopy(a1,b1)"); + _debug_dir("After rcopy(a1,c1)");
This is likely addressed in v0.41. If it happens again we can revisit fresh via github.