Try Perl... 

This example processes all the files in the directory:

$dirname =  shift @ARGV;

opendir(DIR, $dirname) or die "can not open $dirname : $!\n";

while( defined ($filename = readdir DIR) ) {
#$filename = shift @ARGV;

    print "$dirname/$filename\n";

    if($filename ne "." && $filename ne "..") { 
        open(INPUTFILE, "< $dirname/$filename") or die "can not open
$dirname/$filename : $!\n";
        while(<INPUTFILE>) {
                #DO SOMETHING WITH THE FILE'S CONTENTS....                  

        }
    }

}


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 9:39 AM
To: JDJList
Subject: [jdjlist] get the names of all the file under a folder


Hi all,

Does anybody know how to get the names of all the files under a folder?  I
assume we should be able to create an Iterator of the names using some
Class.

Any experience about it?


Thanks and have a great weekend!

TongHua



____________________________________________________________________________
______________________________________________________


This e-mail is intended for the use of the addressee(s) only and may
contain privileged, confidential, or proprietary information that is exempt
from disclosure under law.  If you have received this message in error,
please inform us promptly by reply e-mail, then delete the e-mail and
destroy any printed copy.   Thank you.


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to