473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Mar 30 '07 #1
2 1606
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).

Mar 30 '07 #2
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
Mar 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: paulp | last post by:
Greetings, I'm working on a CGI program that will run under MS IIS 5.0 and will browse folders on three other machines, building HTML pages that will provide links to these folders. ...
2
by: melo | last post by:
Hello, I've been struggling with a function(s) to recursively set all folders and files to NOT read-only. So, I thought I'd post this message. What I need to do is: given a starting path, I...
3
by: Pete Gomersall | last post by:
Hi All, I have seen many examples of deleting folders with subfolders and files. (system.io.directory/info etc delete method) However, I cannot find a decent code example which will work where...
2
by: Glen | last post by:
As I understand it, when the first page of an application is accessed, all ASPX/ASCX/etc. files in the same folder are compiled using the JIT compiler. Is there a way to turn this feature off? ...
2
by: ankita | last post by:
Hello, i am using Asp.net application to read contents of FTP folder. I just want to have names of all folders/files that are inside FTP directory. So for that i don't want to download any...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that scans for files and folders on a specified path and describe them in comma separated values file in a text format. The information is stored in this file consecutively like:...
0
by: alivip | last post by:
Is python provide search in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name camry and file name corola,...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
2
by: csharpula csharp | last post by:
Hello, I am trying to run a code which has an access to some folder that contains files and folders,the strange thing is that this folder becomes read only ,I change it before running the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.