On Thu, Apr 20, 2006 at 02:15:42AM -0700, Paul Eggert wrote:
> 2612 sh -c
> /u/cs/fac/eggert/junk/autoconf-2.59d/tests/autom4te --language=autoconf -
> 2613 /usr/bin/perl -w
> /u/cs/fac/eggert/junk/autoconf-2.59d/bin/autom4te -B /u/cs/fac
> 2680 <defunct>
> 2683 sh -c /usr/bin/csh -cf 'set nonomatch; glob
> /var/run/rpc_door/am4t7535.2613/*'
I do not know how this affects overall performance, but it is easy to avoid.
This patch adopts `File::Path::rmtree' for the task, which uses readdir instead
of globbing. Could you see if it makes a notable improvement on your system?
2006-04-20 Noah Misch <[EMAIL PROTECTED]>
* lib/Autom4te/General.pm (END): Use `File::Path::rmtree'.
diff -urp -X dontdiff ac-clean/lib/Autom4te/General.pm
ac-perlglob/lib/Autom4te/General.pm
--- ac-clean/lib/Autom4te/General.pm 2006-04-01 13:09:07.000000000 -0500
+++ ac-perlglob/lib/Autom4te/General.pm 2006-04-20 20:28:07.000000000 -0400
@@ -38,6 +38,7 @@ use Exporter;
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use File::Basename;
+use File::Path ();
use File::stat;
use IO::File;
use Carp;
@@ -191,24 +192,8 @@ sub END
if (!$debug && defined $tmp && -d $tmp)
{
- if (<$tmp/*>)
- {
- while (<$tmp/*>)
- {
- if (! unlink $_)
- {
- print STDERR "$me: cannot empty $tmp ($_): $!\n";
- $? = 1;
- return;
- }
- }
- }
- if (! rmdir $tmp)
- {
- print STDERR "$me: cannot remove $tmp: $!\n";
- $? = 1;
- return;
- }
+ local $SIG{__WARN__} = sub { $status = 1; warn $_[0] };
+ File::Path::rmtree $tmp;
}
# This is required if the code might send any output to stdout