On Suday the 11th of February, 2007 -after 3 and a half years on InvisionFree, we have moved! This old board remains as a read only archive of years past, and registration has been disabled here. All new and current members should register at http://www.cpplc.net/forum .


Free Forums. Reliable service with over 8 years of experience.
InvisionFree - Free Forum Hosting
Welcome to C++ Learning Community. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Name:   Password:

Please help out
Google

  Reply to this topicStart new topicStart Poll

> Reading a whole directory, Lots of fun in C
feldmarschall
Posted: Feb 5 2007, 01:28 AM
Quote Post


nerd


Group: Members
Posts: 143
Member No.: 2,141
Joined: 3-October 06



So I have a directory of something like 1600 files, and I need to put all their filenames into one big list in a text file.

All I need now is to figure out how to grab all the filenames from the directory, then I can fprintf them all into my text list.

Any suggestions? Been looking through google and havent found anything helpful..I'll try some more.

And it needs to grab the full name blahblah.crap, etc.


--------------------
"You play injured. This isn't baseball." - Jeff Beukeboom.
PMEmail Poster
Top
yankees26
Posted: Feb 5 2007, 03:04 AM
Quote Post


Yes, that is a rectangular Caveman with a Hammer


Group: Members
Posts: 530
Member No.: 1,688
Joined: 23-February 06



You could try using Boost if this is in C++ or if its C or C++ then you could use dirent.h http://www.informit.com/guides/content.asp...seqNum=245&rl=1

But I am not sure how supported dirent.h is.


--------------------

"To the pessimist the glass is half empty, to the optimist the glass is half full, to the computer programmer the glass is twice as large as it needs to be." ~Anonymous

"I have been a scientist and I have been an engineer. I know the difference."
~ Maurice Vincent Wilkes on the term Computer Science (according to wikiquote it is attributed)

user posted image
PMEmail PosterUsers Website
Top
feldmarschall
Posted: Feb 5 2007, 08:32 AM
Quote Post


nerd


Group: Members
Posts: 143
Member No.: 2,141
Joined: 3-October 06



Well I suppose I could do it in a separate C++ project on my box here and then translate the results into the game.

Is boost difficult to use? And what functions in should I be looking at?


--------------------
"You play injured. This isn't baseball." - Jeff Beukeboom.
PMEmail Poster
Top
yankees26
Posted: Feb 8 2007, 11:14 PM
Quote Post


Yes, that is a rectangular Caveman with a Hammer


Group: Members
Posts: 530
Member No.: 1,688
Joined: 23-February 06



I've never actually used boost for this stuff, but take a look at boost::filesystem documentation at boost.org.


--------------------

"To the pessimist the glass is half empty, to the optimist the glass is half full, to the computer programmer the glass is twice as large as it needs to be." ~Anonymous

"I have been a scientist and I have been an engineer. I know the difference."
~ Maurice Vincent Wilkes on the term Computer Science (according to wikiquote it is attributed)

user posted image
PMEmail PosterUsers Website
Top
« Next Oldest | Other Programing Languages | Next Newest »
InvisionFree - Free Forum Hosting
Create your own social network with a free forum.
Learn More · Sign-up for Free

Topic Options Reply to this topicStart new topicStart Poll


Skin selector developed by XJONX. Skins created by various members of the IF Skin Zone and InvisionFree Skinning

Please help out
Hosted for free by InvisionFree* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.1029 seconds | Archive