Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

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.
0
friberg
Asked:
friberg
  • 2
  • 2
1 Solution
 
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now