RE: Help with File::Find

2003-03-10 Thread Kipp, James
> > find { > > preprocess => sub { grep( /My\s+Documents/, @_) }, > > wanted => sub { print "$File::Find::name\n"} > > }, 'c:/test2'; > > Firstly don't forget that Windows treats the 'My Documents' directory > as a special case. Windows Explorer shows it at the same tree level > as My

Re: Help with File::Find

2003-03-08 Thread Rob Dixon
James Kipp wrote: > Steve's suggestions worked great for ignoring or not recursing > directories, but I am unable to filter out all directories not named > "My Documents" . I have tried using regex and grep to filter them out > but no luck > > this fails, just goes to the root directory and exits,

Re: Help with File::Find

2003-03-07 Thread Steve Grazzini
James Kipp <[EMAIL PROTECTED]> writes: > > Thanks Steve. > So I could use either one of these methods, like: > > # skip dirs with Profile > find { > preprocess => sub { grep !/Profile/, @_ }, > wanted => sub { print if ($File::Find::name =~ /.*\.pst$/) } > }, 'f:/users/user1';

RE: Help with File::Find

2003-03-07 Thread Kipp, James
Steve's suggestions worked great for ignoring or not recursing directories, but I am unable to filter out all directories not named "My Documents" . I have tried using regex and grep to filter them out but no luck this fails, just goes to the root directory and exits, and the docs really don't sa

RE: Help with File::Find

2003-03-07 Thread Kipp, James
> Of course. > > #!/usr/bin/perl -l > > use File::Find; > use warnings; > > # > # ignore > # > find { > preprocess => sub { grep $_ ne __FILE__, @_ }, > wanted => sub { print } > }, "."; > > # > # don't recurse > # > find sub { > if ($_ eq __FILE__) { ++

Re: Help with File::Find

2003-03-07 Thread Steve Grazzini
James Kipp <[EMAIL PROTECTED]> writes: > Is there a way to get File::Find to TOTALLY ignore a directory?? Of course. #!/usr/bin/perl -l use File::Find; use warnings; # # ignore # find { preprocess => sub { grep $_ ne __FILE__, @_ }, wanted => sub { print } }, ".";

Re: Help with File::Find

2002-01-11 Thread Nick_D_Montpetit
Fowler To: [EMAIL PROTECTED] Subject: Re: Help with File::Find

Re: Help with File::Find

2002-01-11 Thread Michael Fowler
On Fri, Jan 11, 2002 at 10:57:48AM -0600, [EMAIL PROTECTED] wrote: > all files (including the previously missed ones) are printed out (also > along with the directories now) as expected, but for the files that would > not have passed the (-e $_) test, the values assigned for filesize and age > in

Re: Help with File::Find

2002-01-11 Thread Nick_D_Montpetit
nton Gibbs" farms.com>cc: Subject: Re: He

Re: Help with File::Find

2002-01-11 Thread John W. Krahn
Nick D Montpetit wrote: > > Hi Everyone! Hello, > I'm fairly new to Perl, and completely new to submitting to the list, so > please be easy on me. :-) I'll try. > The purpose of the code I wrote (listed below) is to go through the current > directory and all of its subdirectories and report

Re: Help with File::Find

2002-01-11 Thread Nick_D_Montpetit
I meant to post my original code, where line 11 used the -f file test (so that directories wouldn't be included in the output). My questions still apply when using -f instead of -e. If we could refer the email below for future discussion, that would be great! Sorry about the screwup. :-) Than

RE: Help with File::Find

2002-01-11 Thread Nick_D_Montpetit
> [EMAIL PROTECTED] cc: 01/11/02 11:06 AMSubject: RE: Help with File::F

RE: Help with File::Find

2002-01-11 Thread John Edwards
Something I just found via a google search... foreach (@_) { $min = $_ if $min > $_; } $min now holds the smallest value of the array. BTW, shouldn't line 21 be write $fileref STDOUT? I've not gone over the code, but if you are looking for the smallest array value, then only writing out

RE: Help with File::Find

2002-01-11 Thread Kipp, James
> 8: > 9: sub wanted{ > 10: my $flag = 0; > 11: if (-e $_){ > 12: push(@filelist, [$File::Find::name, -s $_, -M $_]); don't know if you need the -e here, it is redundant. you might want to use -f test to just find and stat regular files. here is a snip from a script i did and use alot and

RE: Help with File::Find

2002-01-11 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 11, 2002 11:58 AM > To: [EMAIL PROTECTED] > Subject: Help with File::Find > > > Hi Everyone! > > I'm fairly new to Perl, and completely new to submitting to > the list, so > please be easy

RE: Help with File::Find

2002-01-11 Thread Wagner-David
$_ in the Find::File setup has only the filename. You need to check $Find::File::name which holds the full filename. Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 08:58 To: [EMAIL PROTECTED] Subject: Help with File: