On Sat May 10 03:58:20 2008, ANDK wrote:
Show quoted text
The problem is in lib/Test/Kwiki.pm, line 53:
sub cleanup {
io($self->base_dir)->rmtree unless $ENV{KWIKI_TEST_DIRTY};
}
If I read this right, the current working directory is $self->base_dir,
and you are asking to remove $self->base_dir while you are still in it.
The File::Path 2.x code base contains code that originally came from the
Debian project to prevent race conditions (people modifying the
directory tree as it was being deleted). As a result, File::Path now
manipulates the current working directory as it tracks the directories
being removed.
At the end of the run it restores the current working directory to what
it was previously. And since we've just blown that directory away it
cannot do that.
The solution is to chdir to an existing location (that will continue to
exist after rmtree() has completed) before removing the directory tree.
Something as simple as chdir(File::Spec->updir) should do the trick in
the present case.
Thanks,
David Landgren