Chris Wagner wrote:

> Ah I see.  I don't think plain perl can do that well, 

Can't do what well ?  Do you expect us to delve through our trash
folders looking for the post you are responding to ?  Leave enough
context so we know what you're talking about.

>                                                        but there might be
> some modules that can do it.  I would do it with Cygwin.  If all the dirs
> are under the same point...
> 
> #!perl.exe
> @dirs = `find ./ -type d`; # gets all subdirectories
> chomp @dirs;
> foreach $dir (@dirs) {
>         $dir =~ s#/#\\#g;
>         print "Newest file modification in $dir is ", substr( ( `command.com
> /c dir "$dir" /o-d /a-d` )[5], 29, 15), "\n";
> }
> 
> That won't work with empty directories.  That adds some complexity.

You can easily do this with Perl core modules and in most cases,
it would be just as fast.  This is just a simple recursive readdir
problem and if that's to tough for you to code, File::Find will
do it for you.

use strict;
use warnings;
use File::Find;

my $dir = shift || "C:/";
print "$dir: \n";
find (\&wanted, $dir);

sub wanted {

return if /^\.{1,2}$/;
print "$File::Find::name: \n" if -d;
print "\t$File::Find::name\n" if not -d;

}

__END__


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to