Skip Menu |

This queue is for tickets about the Filesys-DiskUsage CPAN distribution.

Report information
The Basics
Id: 48227
Status: resolved
Priority: 0/
Queue: Filesys-DiskUsage

People
Owner: Nobody in particular
Requestors: BOLDRA [...] boldra.org
Cc:
AdminCc:

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



Subject: global filehandle DIR locks directory (test and patch included).
I was trying to remove with File::Path::rmtree under cygwin and hitting an error, 'directory not empty'. To reproduce: perl -MFile::Path -MFilesys::DiskUsage -E ' mkpath("/tmp/a/b/c"); Filesys::DiskUsage::du("/tmp/a/b"); rmtree("/tmp/a"); ' The solution was to make the dirhandle for opendir a local variable. Calling closedir also solves the problem. diff: 208c208 < opendir( my $dh, $_ ); --- Show quoted text
> opendir(DIR,$_);
214c214 < }, map {"$dir/$_"} grep {! /^\.\.?$/} readdir $dh ); --- Show quoted text
> }, map {"$dir/$_"} grep {! /^\.\.?$/}
readdir DIR );
Fixed in 0.09