how to read txt files in unknown folders



 DEVELOP > c-Plus-Plus > how to read txt files in unknown folders

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
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
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER