Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing All Files in a given Directory...

Status
Not open for further replies.

onrdbandit

Programmer
Mar 12, 2003
145
US
Howdy,

I am attempting to start an application to do batch type operations to files. I want to be able to process any file in a given directory, but I can't find any methods to get a list of files in a directory, or to step through the files in a directory.

I want to avoid having to select files individually as these processes will be done on hundreds of files. (that would essentially defeat the purpose)

Any suggestions would be welcomed...

Thanks,
onrdbandit
 
Look at FindFirst() and FindNext(), they should do what You need.

Have fun!
 
If you are using Borland .. I use this method.

In the Win 3.1 tab there is a control called FileListBox, give it a directory and a file mask and use the Update() method . FileListBox->Items is a stringlist of files in that directory!

Regards

Plus if it's a batch program with no form . You can instantiate FileListBox at runtime.
 
You can also use FindFirstFile,FindNextFile and FindFirstFileEx.
Good luck!!
 
Gracias fellas!

I'll look into those methods...

onrdbandit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top