zl2khi, 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