read files from a directory ...
Posted on 2006-04-24
I have several files such as:
dog.pet, cat.pet, bird.pet, elephant.pet ...etc., all in the "Animal" folder.
There are also files called ant.bad, fly.bad ... etc. in the Animal folder as well.
How do I open the *.pet files, read some info in the file, and then store the filename (eg. dog, cat ...) in to an array ?
I mean I want an array storing : dog, cat, bird, elephant ... etc.
And of course, I don't know how many files in Animal are "*.pet" files at very beginning ...
Is this something possible ? thanks.