Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Handling directories with C++

Reply
Thread Tools

Handling directories with C++

 
 
Jamie Vicary
Guest
Posts: n/a
 
      08-11-2004
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

 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      08-11-2004
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.

 
Reply With Quote
 
 
 
 
JKop
Guest
Posts: n/a
 
      08-12-2004
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
 
Reply With Quote
 
Jeff Flinn
Guest
Posts: n/a
 
      08-12-2004

"Jamie Vicary" <> wrote in message
news:cfdf02$dm4$...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Directories and Physical directories Paul M Fin MCAD 4 06-27-2008 07:50 PM
virtual directories/physical directories in IIS Paul F ASP .Net 4 06-25-2008 04:04 PM
Multiple bin-directories with virtual directories? =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?= ASP .Net 0 11-09-2004 05:49 PM
How to map Project directories to Production sub-directories Joel Finkel ASP .Net 0 09-12-2003 06:47 PM
Using virtual directories for common directories (scripts, images, styles, etc.) Jeffry van de Vuurst ASP .Net 2 07-30-2003 07:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57