Hi There
I moved the stat up before I've modified the path names but I'm still getting a 0 for directory size, and I've found by printing $_ I'm not actually getting the required pattern match IPDLMY\d{8}$/ at times either... I think I'm going to have to resort to not using File::Find in this instance...
sub all { #Unless directory skip. return unless -d; # Don't recurse past folders matching the pattern. $File::Find::prune = 1 if /[IPDLMY]\d{8}$/; #How big is it? my $fsize = (stat($_))[7]; print "$fsize\n"; push @sfiles, $fsize; #Replace / with \ (my $fn = $File::Find::name) =~ tr#/#\\#; #Replace gpfs_data with nas\rdds $fn =~ s/gpfs_data/nas\\rdds/; #Push into the @allpathlisting array any paths matching the patter +n. push @allpathlisting, $fn if /[IPDLMY]\d{8}$/; #print results to the screen, comment this out in production. print "$fn\n" if /[IPDLMY]\d{8}$/;
In reply to Re^2: File::Find stat question
by Anonymous Monk
in thread File::Find stat question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |