Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: stoian.iovchev [...] imperia.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.16
Fixed in: 0.17



Subject: rmove does not work correctly under Win
Hi, I am using File::Copy::Recursive like this: my $dir = 'c:\temp\some\dir'; if (-d $dir) { unless (rmove(File::Spec->catdir ($dir), File::Spec->catdir ($dir, 'old'))) { die ("Cannot move directory " . File::Spec->catdir ($dir) . " to directory " . File::Spec->catdir ($dir, 'old') . ": $!\n ); } The error set in $! is : "c:\temp\some\dir" is not a directory. The problem seem to be in function pathempty () and specifically at line 211 in "close PTH;" statement. When changed to "closedir PTH;" everything works fine :) I have attached a patch. Wishing all the best Stoian PS: OS: WinXP SP1 Perl 0 v5.8.7 built for MSWin320x86-multi-thread ... binary build 813 [148120] provided by ActiveState ...
Subject: patch
Download patch
application/octet-stream 209b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #17295] rmove does not work correctly under Win
Date: Thu, 26 Jan 2006 11:45:48 -0600
To: bug-File-Copy-Recursive [...] rt.cpan.org
From: SimpleMood Webmaster <webmaster [...] simplemood.com>
On Jan 26, 2006, at 10:37 AM, Guest via RT wrote: Show quoted text
> > Thu Jan 26 11:37:41 2006: Request 17295 was acted upon. > Transaction: Ticket created by guest > Queue: File-Copy-Recursive > Subject: rmove does not work correctly under Win > Owner: Nobody > Requestors: stoian.iovchev@imperia.net > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=17295 > > > > Hi,
Hello, Show quoted text
> I am using File::Copy::Recursive like this: > my $dir = 'c:\temp\some\dir'; > if (-d $dir) { > unless (rmove(File::Spec->catdir ($dir), > File::Spec->catdir ($dir, 'old'))) { > die ("Cannot move directory " . File::Spec->catdir > ($dir) > . " to directory " > . File::Spec->catdir ($dir, 'old') . ": $!\n ); > }
For clarity this code causes the problem, correct: my $orig = 'c:\temp\some\dir'; my $old = File::Spec->catdir($dir, 'old'); rmove($orig, $old) or die "rmove $orig $old failed: $!" if -d $dir; Its much easier to decifer what is going on with that code since its much much cleaner and reads like a sentence :) Show quoted text
> The error set in $! is : > "c:\temp\some\dir" is not a directory. > > > The problem seem to be in function pathempty () and specifically at > line 211 in "close PTH;" statement. When changed to "closedir PTH;" > everything works fine :) > > I have attached a patch.
Thanks for the excellent details, I'll take a look and post back to ticket 17295! Show quoted text
> Wishing all the best > Stoian > > > PS: > > OS: WinXP SP1 > Perl 0 v5.8.7 built for MSWin320x86-multi-thread ... > binary build 813 [148120] provided by ActiveState ... > > > <patch>
Subject: Re: [rt.cpan.org #17295] rmove does not work correctly under Win
Date: Thu, 26 Jan 2006 12:04:31 -0600
To: bug-File-Copy-Recursive [...] rt.cpan.org
From: SimpleMood Webmaster <webmaster [...] simplemood.com>
On Jan 26, 2006, at 11:46 AM, SimpleMood Webmaster via RT wrote: Show quoted text
... Show quoted text
> For clarity this code causes the problem, correct: > > my $orig = 'c:\temp\some\dir'; > my $old = File::Spec->catdir($dir, 'old'); > rmove($orig, $old) or die "rmove $orig $old failed: $!" if -d $dir;
... Show quoted text
>> The problem seem to be in function pathempty () and >> specifically at >> line 211 in "close PTH;" statement. When changed to "closedir PTH;" >> everything works fine :) >> >> I have attached a patch.
Thanks again for bringing it to my attention, I just uploaded 0.17 to cpan, I did not use the patch, see changelog for details Thanks! Dan Muey
Resolved in 0.17, which is on CPAN now but is not in the menu for "Fixed in"