| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"zl2k" |
| Date: |
29 Mar 2007 09:07:51 PM |
| Object: |
how to read txt files in unknown folders |
hi, all
I am given a root folder, there are sub-folder and sub-sub-...folders
under the root folders. There are also many txt files at any level of
the folders. How can I automatically visit all those txt files? The
structure of the folder tree is unknown. Thanks for help. I am using
gnu c++.
zl2k
.
|
|
| User: "red floyd" |
|
| Title: Re: how to read txt files in unknown folders |
29 Mar 2007 10:07:55 PM |
|
|
zl2k wrote:
hi, all
I am given a root folder, there are sub-folder and sub-sub-...folders
under the root folders. There are also many txt files at any level of
the folders. How can I automatically visit all those txt files? The
structure of the folder tree is unknown. Thanks for help. I am using
gnu c++.
ISO/IEC 14882:2003 does not discuss filesystems. You need to ask in a
group dedicated to your platform/OS. Alternatively, Boost may have
something (http://www.boost.org).
.
|
|
|
| User: "James Kanze" |
|
| Title: Re: how to read txt files in unknown folders |
30 Mar 2007 04:36:21 AM |
|
|
On Mar 30, 5:07 am, red floyd <no.s...@here.dude> wrote:
zl2k wrote:
I am given a root folder, there are sub-folder and sub-sub-...folders
under the root folders. There are also many txt files at any level of
the folders. How can I automatically visit all those txt files? The
structure of the folder tree is unknown. Thanks for help. I am using
gnu c++.
ISO/IEC 14882:2003 does not discuss filesystems. You need to ask in a
group dedicated to your platform/OS. Alternatively, Boost may have
something (http://www.boost.org).
Boost::filesystem has a director_iterator, and a possibility to
ask whether a given path is a directory or not. Given that,
it's trivial to write a recursive function which visits all
sub-directories.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34
.
|
|
|
|
|

|
Related Articles |
|
|