473,396 Members | 1,891 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,396 software developers and data experts.

How can i open a directory

Hi all,
i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.i tried it by including header file dirent.h.but its giving
error as shown below.
: fatal error C1083: Cannot open include file: 'dirent.h': No such
file or directory
please suggest me if any other way to overcome this
problem.
Thanks in advance.

Sep 7 '06 #1
7 5512
lakshmi wrote:
Hi all,
i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.i tried it by including header file dirent.h.but its giving
error as shown below.
: fatal error C1083: Cannot open include file: 'dirent.h': No such
file or directory
please suggest me if any other way to overcome this
problem.
Thanks in advance.
Ask in a VC++ group, this is a platform rather than a C question.

--
Ian Collins.
Sep 7 '06 #2
"lakshmi" <la************@gmail.comwrote:
i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.
RTFF: <http://c-faq.com/osdep/readdir.html>

Richard
Sep 7 '06 #3
lakshmi a écrit :
Hi all,
i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.i tried it by including header file dirent.h.but its giving
error as shown below.
: fatal error C1083: Cannot open include file: 'dirent.h': No such
file or directory
please suggest me if any other way to overcome this
problem.
Thanks in advance.
The first thing you have to learn is how to read the documentation.
VC++ comes with a lot of documentation and you will have to learn how to
use it before continuing. Go (in the IDE) to the Help menu item
and look what is in there.

Learn how to read and find functions in there because if you
don't you will come back here at each thing that you want to do.

HINT
findfirstfile
findnextfile
Sep 7 '06 #4
lakshmi wrote:
>
i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.i tried it by including header file dirent.h.but its giving
error as shown below.
: fatal error C1083: Cannot open include file: 'dirent.h': No such
file or directory
I suspect there is no such file as "file.iam", or "compiler.how" or
"directory.i" on your system. There certainly is no such include
file as "dirent.h" on a standard C system.

Hint: You are allowed to insert blanks after a sentence, and the
personal pronoun I is always capitalized.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Sep 7 '06 #5
Check if the include path in your IDE is set correctly...
If yes then check if the exist in the system or not..

-Ratan

CBFalconer wrote:
lakshmi wrote:

i need to open multiple files that are in directory and parse
each file.iam using c language in VC++ compiler.how can i open a
directory.i tried it by including header file dirent.h.but its giving
error as shown below.
: fatal error C1083: Cannot open include file: 'dirent.h': No such
file or directory

I suspect there is no such file as "file.iam", or "compiler.how" or
"directory.i" on your system. There certainly is no such include
file as "dirent.h" on a standard C system.

Hint: You are allowed to insert blanks after a sentence, and the
personal pronoun I is always capitalized.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Sep 8 '06 #6
"Ratan" <ra*******@gmail.comwrites:
Check if the include path in your IDE is set correctly...
If yes then check if the exist in the system or not..
Ratan, please don't top-post.

See <http://www.caliburn.nl/topposting.htmlfor an explanation, and
most of the articles in this newsgroup for examples of how to do it
right.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 8 '06 #7
"lakshmi" <la************@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Hi all,
i need to open multiple files that are in directory and parse
each file.
Just go away and use VB:

-----------------------------
Sub DoDirs (cwd)

For Each objFolder in cwd.SubFolders

For Each fname in objFolder.Files

'do something with the files

Next

' recurse
DoDirs objFolder

Next

End Sub

' Get the current working directory (cwd)
Set fso = CreateObject("Scripting.FileSystemObject")
Set cwd = fso.GetFolder (".")

DoDirs (cwd)
-----------------------------
--
Mabden
Sep 30 '06 #8

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

Similar topics

6
by: haynesc | last post by:
Hi, I'm having a problem where when trying to open a file in write mode, I get an IOError stating no such file or directory. I'm calling an external program which takes an input file and...
0
by: jbailo | last post by:
http://dmoz.org/license.html The Open Directory is a compilation of many different editors' contributions. Netscape Communications Corporation (`Netscape') owns the copyright to the compilation...
0
by: KevinGravelle | last post by:
Hello, I am running an Apache web server and my httpd configuration file is utilizing the aspdotnet_module in order to run an ASP.NET application. Whenever I try and open my existing web...
5
by: John Black | last post by:
Hi, I have a code to open a file like this, int r = open("file1", O_RDONLY, 0); let's say the executable a.out is at <dir> and file1 is also at <dir>, then no problem. The problem is when...
0
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
4
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
6
by: Bruce | last post by:
I am doing development work on an asp.net app and a web service on a Win XP Pro SP2 development workstation, using vs.net 2003. For reasons that I wont try to explain here, I recently moved the...
0
by: Paul Brady | last post by:
I volunteer at a youth ministry agency and help them with their student database. They have two computers, both running Windows XP. Both have Office 2002 installed without Access, except that...
24
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
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...

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.