By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

Handling directories with C++

P: n/a
Dear all,

Despite a good few hours of googling, I have been unable to find out
what the standard C++ libraries are for handling directories and getting
a list of the files inside them.

I am using the mingw c++ compiler on a windows machine to write a
console application. system("mkdir blah") calls aren't what I need
because I need return values to check for things going wrong.

It's the sort of thing that's easy if you know the answer, but
impossible if you don't...

Thanks,

Jamie

Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jamie Vicary wrote:
Dear all,

Despite a good few hours of googling, I have been unable to find out
what the standard C++ libraries are for handling directories and
getting a list of the files inside them.
C++ only has one standard library, and that doesn't provide any
functionality for directory handling.
I am using the mingw c++ compiler on a windows machine to write a
console application. system("mkdir blah") calls aren't what I need
because I need return values to check for things going wrong.

It's the sort of thing that's easy if you know the answer, but
impossible if you don't...


You have to use system-specific functions, or maybe boost helps.

Jul 22 '05 #2

P: n/a
Jamie Vicary posted:
Dear all,

Despite a good few hours of googling, I have been unable to find out what the standard C++ libraries are for handling directories and getting a list of the files inside them.

I am using the mingw c++ compiler on a windows machine to write a console application. system("mkdir blah") calls aren't what I need because I need return values to check for things going wrong.
It's the sort of thing that's easy if you know the answer, but impossible if you don't...

Thanks,

Jamie


On Windows:

FindFirstFileEx
FindNextFileEx
FindClose
-JKop
Jul 22 '05 #3

P: n/a

"Jamie Vicary" <Xj************@Xmansf.Xox.Xac.Xuk> wrote in message
news:cf**********@uns-a.ucl.ac.uk...
Dear all,

Despite a good few hours of googling, I have been unable to find out
what the standard C++ libraries are for handling directories and getting
a list of the files inside them.

I am using the mingw c++ compiler on a windows machine to write a
console application. system("mkdir blah") calls aren't what I need
because I need return values to check for things going wrong.

It's the sort of thing that's easy if you know the answer, but
impossible if you don't...

See http://www.boost.org/libs/filesystem/doc/index.htm for a portable, and
IMHO, the best solution.

Jeff F
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.