Getting a list of files in a directory

I want to get a list of all the *.html files in a certain directory, say c:\temp. I use CBuilder and know about the findfirst/findnext functions, but these seem to be windows specific. Is there a unix compatible way of doing it?
Any help appreciated.
fribergAsked:
Who is Participating?
 
msmitsCommented:
You might want to look at:

opendir()
readdir()
closedir()

I don't have my Borland stuff online to check availability, but those are the UNIX calls.
0
 
nietodCommented:
But CBuilder is for windows, not unix????
0
 
fribergAuthor Commented:
Thanks, those are available in both unix and windows. :)
0
 
nietodCommented:
If they are available in CBuilder, they are interface functions that borland suplied to make it easier to port unix code to windows.  They are not actually windows functions, they just call the actual windows functions to do the work.  (Using them is okay, but you shoudl understand what they really are and the potential consequences of that.)
0
 
fribergAuthor Commented:
nietod, thanks for the info. I tested them, and they work fine. I really want my code to be unix portable, so this was exactly what I was looking for. It's easy to accidentally use functions that are windows only...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.