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>