On Mar 30, 5:07 am, red floyd <no.s...@here.dudewrote:
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:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34