wrote:
> I am trying to get Directory content list in VC++ 2003, here is my
> code:
>
> DIR *pdir;
> struct dirent *pent;
> char str[2000];
> pdir=opendir("./users/" + FullName); //"." refers to the current dir
> // if the dir doesnt exists, create it
> if (!pdir){
> mkdir("./users/" + FullName);
> }
>
> It says to use dirent.h and i cannot find it or it has not been found.
> Can someone please help, am i doing something wrong or is there another
> way of doing it???
>
This is Unix/Linux code (DIR, opendir(), dirent).
Do the Microsoft headers/libs support/contain these functions
and structures?
Also, opendir() and mkdir() take C strings (char *) as their
args, not C++ std::string args. So the syntax like
"./users/" + FullName
won't work.
Larry