develooper Front page | perl.beginners | Postings from January 2002

RE: File::Find and Platform Capability

Thread Previous | Thread Next
From:
McCollum, Frank
Date:
January 30, 2002 12:14
Subject:
RE: File::Find and Platform Capability
Message ID:
59B292A4FEF3D411A10600508B6F27B2036C4F6D@clttmp21.ncmi.com
I do not have a good grasp of File::Find, but I found a way that works and
just go with it...


	find(sub {push @files, $File::Find::name  if -f}, '.'); #grabs all
files

	find(sub {/$ord/i && push @files, $File::Find::name  if -f}, '.');
#grabs files whose name matches $ord

Files are pushed into the @files array, and I just moved on from there and
decided to learn the details later.

-Frank

-----Original Message-----
From: J.Hourihane@cdcixis-cmna.com [mailto:J.Hourihane@cdcixis-cmna.com]
Sent: Wednesday, January 30, 2002 3:03 PM
To: beginners@perl.org
Subject: Re: File::Find and Platform Capability


I am having difficulty opening a directory and recursively listing the files
on NT Win32
I can do it on Unix but when I try it on NT with both UNC and drive letter I
get nothing...

Unix 
#######################
!/util/perl5.static -w
use File::Find;
open(OUT, ">docs.out");

 sub wanted
 {
	
     print OUT "$File::Find::name\n";

 }

 find( \&wanted, "/docs/1");

close(OUT);
#####################

NT
######################
use File::Find;
open(OUT, ">docs.out");

 sub wanted
 {
	
     print OUT "$File::Find::name\n";

 }

 find( \&wanted, "D:\\");

close(OUT);
#######################

Jaime Hourihane

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


_____________________________________________________________________ 
IMPORTANT NOTICES: 
          This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.

         Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.

         BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.
										
____________________________________________________________________

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About