Here's a little code snippet that could be modified to suit your needs.
use Win32::OLE qw(in with);
use File::Basename;
my ($FileName, $folder, $ext);
opendir(NT, $folder) || die "Didn't find folder";
foreach $FileName (sort readdir(NT)) # list context, sorted
{
#Split the file name into the name and extension
my $ext = (fileparse($FileName,'\..*'))[2];
$ext =~ s/^\.//; #Strip the first . (period) from the
extension
if ($ext eq "txt") #Then this is a file to attempt to process
{
#Do what you need to do to the file here
}
} #For each file in the folder
closedir(NT);
-----Original Message-----
From: Anton Arhipov [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 15, 2001 6:09 AM
To: [EMAIL PROTECTED]
Subject: Directory scan
Hello,
I need to scan a directory and generate a list of its files...
(preferably a txt with all the filenames)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]