The ideas will come down to getting a list of all the files with the extension ".dat", using glob and counting the elements in the returned array (see scalar), or you could open the directory of interest, and read the names of the files, and increment a counter when the file's name ends in .dat.
I'd use glob and count the number of elements in the returned list; chances are that there won't be more than a few hundred files with names ending in /\.dat$/i, so memory use won't be a concern.
Or you could install cygwin and do this:
ls *.dat | wc
emc
Insisting on perfect safety is for people who don't have the balls to live in the real world.
—Mary Shafer, NASA Dryden Flight Research Center
|