473,404 Members | 2,187 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,404 software developers and data experts.

read directory and sub-directory

I have many directorys and sub_directory and many files in each of them.
I want to write a C/C++ program to read and to control all files with .h and .cpp extension.
How can I do?


Please help me.
I really need your great help. thank you.
May 10 '07 #1
5 5402
AdrianH
1,251 Expert 1GB
I have many directorys and sub_directory and many files in each of them.
I want to write a C/C++ program to read and to control all files with .h and .cpp extension.
How can I do?


Please help me.
I really need your great help. thank you.
What OS? POSIX defines opendir() and other functions which you may use.

See here, and here for more info.


Adrian
May 10 '07 #2
it's windows...and i use FindFile functions but i must to enter in all sub-directory....
May 10 '07 #3
AdrianH
1,251 Expert 1GB
it's windows...and i use FindFile functions but i must to enter in all sub-directory....
Sorry, I guess I wasn't clear. POSIX is a standard, not an OS. Windows should adhere to it so you could use the functions I described.

FindFile is not Win32. Did you get that from codeproject?

If you want to use Windoze calls try looking up FindFirstFile(), FindNextFile(). You can also use MFC's CFileFind class.


Adrian
May 10 '07 #4
mmm...i use visual studio 2003.....but when i compile, the library.h cause :
"'dirent.h': No such file or directory"....

sorry for my english but i speak italian....thank you
May 10 '07 #5
AdrianH
1,251 Expert 1GB
mmm...i use visual studio 2003.....but when i compile, the library.h cause :
"'dirent.h': No such file or directory"....
Yeah, that's no big surprise. M$'s POSIX compliance is kinda lax.

Then try the MSDN site here.
sorry for my english but i speak italian....thank you
No problem. Sounds good to me.


Adrian
May 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Gurk | last post by:
hi the settings of my program are stored in an ini file, is there a simple way to open the file in some textbox, ore a betteer soutable box. i also want it to be able to resave the ini so...
4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
12
by: Ron | last post by:
What is the VB equivalent of the READ...DATA statements in QuickBasic? Thanks
16
by: Adda | last post by:
If I cycle through the MdiChildActivate event of the parent form I can read text in a textbox on the child mdiform -- console.writeline(Me.ActiveMdiChild.Controls(1).Text) But if I have a sub...
1
by: oni | last post by:
hi all, the program should be able to log on to a pop mail account and need to just read its headers and display. any help in this regard highly apperecialted. code pref VB.NET thankz in...
3
by: jamal | last post by:
HI guys I want to make a program that will read my external pop3 e-mail account and save them to an access/sql file on my workstation. what you guys think ? Can I make something like this with...
1
by: Tolgay Gül | last post by:
I need some codes that able to send and read data by serialport in VB.Net 2005 beta 2. I wrote some codes and It can send data via serialport but It cannot read what I send. I have looked up on...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
7
by: Tracks | last post by:
I have old legacy code from vb5 where data was written to a file with a variant declaration (this was actually a coding error?)... in vb5 the code was: Dim thisdata as integer Dim thatdata...
3
by: Ray | last post by:
Hello World, I made a Windowsform that reads data from a CSV file. It works fine, but when I have read the data of a record I have to re-Debug the form to read another record. So when I put a...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.