Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Estok

Accessing Filenames in Directory

This topic is 5720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am programming using Visual C++ and would like to access load all the files with a specified extension in a directory. For example, when my program begins, I want my program to load all the mesh files with extension .x under a mesh directory. What funcion calls can I use to obtain a list of filenames in the directory? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
FindFirstFile(), FindNextFile() and FindClose().

http://msdn.microsoft.com/ should be required link for anyone programming on Windows.

Share this post


Link to post
Share on other sites
Hey, I''ve been after something similar... how do I do the same thing under Unix/Linux? I''m porting an archiver (sorta like TAR) I wrote in Win32 over to Linux, and I''m looking for something similar to that I can use...

I don''t want to have to "ls -1 > /tmp/packlist" and parse the file...

Share this post


Link to post
Share on other sites
The POSIX (and linux/bsd) way to read directories is the opendir/readdir/closedir functions.
Your local man page should have more details.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!