files and subdirectories

G

Gaijinco

I'm looking for libraries to handle basic operations on files and
subdirectories as listing the files and the subdirectories of a
directory.

Someone suggest me <dirent.h> (which is supported by g++) but I
couldn't find clear information about its usage.

Does anyone knows a more documented alternative? Or a good reference to
<dirent.h>?

Thanks.
 
J

Jacek Dziedzic

Gaijinco said:
Does anyone knows a more documented alternative? Or a good reference to
<dirent.h>?

Try typing "dirent.h" into google and clicking on the first
entry returned. Worked for me.

HTH,
- J.
 
M

Marcus Kwok

Gaijinco said:
I'm looking for libraries to handle basic operations on files and
subdirectories as listing the files and the subdirectories of a
directory.

Someone suggest me <dirent.h> (which is supported by g++) but I
couldn't find clear information about its usage.

Does anyone knows a more documented alternative? Or a good reference to
<dirent.h>?

Try the Boost Filesystem library.
 
F

F.J.K.

Gaijinco said:
I'm looking for libraries to handle basic operations on files and
subdirectories as listing the files and the subdirectories of a
directory.

Someone suggest me <dirent.h> (which is supported by g++) but I
couldn't find clear information about its usage.

Does anyone knows a more documented alternative? Or a good reference to
<dirent.h>?

Thanks.

Do you really need a library, or do you just need to read a directory?
A quick hack would be to use the system function.

system("cmd /C \"dir /b > myprog.dir\"");
ifstream dir("myprog.dir");

Other than that: read the plattform specific documentation that came
with your OS and/or compiler. There is some kind of interface to handle
directories on each plattform, you just need to find it.
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top