Listing directory contents on VC++ 2008

How can I list directory contents using Visual C++ 2008 Express Edition ?

I tried opendir and readdir from dir.h and dirent.h, but these libs are not available.

Please, can anybody help me?
Last edited on
You mean like <iostream> or <fstream>?
Just use Win32 api (FFF)
But I can't find any class on <iostream> and <fstream> to manipulate directory.

ofstream, ifstream and fstream have methods for file manipulating, but I want to manipulate directories.

Which class or method should I use?

I read something about methods called FindFirst and FindNext, but I can't find them either.

Even here, I saw this post that does't work for me, because I can't use readdir() since dir.h and dirent.h are not available on VC++ 2008:

srini (3) Aug 11, 2008 at 3:09am
hi,

how can i read the contents of directory.
suppose a directory is having some .txt files. now i want to read all the file one by one. how can i implement a code in c++.

Thanking you,
srinivas.
|
jsmith (958) Aug 11, 2008 at 10:47am
Use opendir() and readdir(). (man 3 opendir and man 3 readdir).
Continue calling readdir() until it returns NULL. Each call to readdir returns the "next" directory entry. Be aware that readdir() will return "." and ".." as directory entries...
Try to find a download for the files you need.
Just googling, I've found this: http://www.softagalleria.net/dirent.php
Topic archived. No new replies allowed.