How can i open a directory

L

lakshmi

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.
 
I

Ian Collins

lakshmi said:
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.
 
J

jacob navia

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
 
C

CBFalconer

lakshmi said:
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.
 
R

Ratan

Check if the include path in your IDE is set correctly...
If yes then check if the exist in the system or not..

-Ratan
 
M

Mabden

lakshmi said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top