Skip to main content
GameDev.net gamedev.net
🔒 Locked

getting Folder / directory info

Started by MTclip Mar 12, 2005 at 10:07 PM 2 replies 850+ views
Original Post
MTclip
MTclip
I am looking for a way to get information about the contents of a folder I to writing a programm that will require me to check the folder contents that the .exe is in. I am then going to create a file with information about the files inside that folder. anyways after looking for seriously hours and hours i can find nothing on gaining access to folders using vc++ if any body knows what i should use for this kind of operation, that would be awesome ..........
crucifer
crucifer
Here's a great link that should help you :

http://www.codeproject.com/cpp/recursedir.asp

Basicly,

1-you search from a specific folder with criterias (ie : "*.exe")
2-you receive ONE result
2-you ask for the NEXT result until you have them all
Shannon Barber
Shannon Barber
boost::fs::directory_iterator

The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Dead Eye
Dead Eye
under windows, use FindFirstFile and FindNextFile passing a wildcard in the firstfile call. for directories, test for (find32.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY). make sure to ignore the directories named "." and ".." unless they are needed. if not a directory, then it is a file and you can use the other file attribute flags to test for hidden, read-only, encyrpted etc...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.