November 15, 2001 findfirst returns NULL | ||||
---|---|---|---|---|
| ||||
Hi folks, I tried the example code for the 'findfirst/findnext' functions. It works in the DOS/DOSX memory models but built as a WIN32 console app 'findfirst' always returns NULL. As there definitely are files present, this looks like a bug. Or did I miss something? I don't have the library source, so can't check it myself (but like to buy the CD, maybe you can arrange something apart from paypal ?). |
November 15, 2001 Re: findfirst returns NULL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Linus | The address you can send a check or money order to is at:
www.digitalmars.com/shop.html
I'll check into the findfirst problem. In the meantime, you might prefer to go directly to the win32 API with code like:
Array *getFiles(char *c)
{
Array *a;
HANDLE h;
file_t fileinfo;
a = new Array();
h = FindFirstFileA(c,&fileinfo);
if (h != INVALID_HANDLE_VALUE)
{
do
{ file_t *f;
// Skip "." and ".."
if (strcmp(fileinfo.cFileName, ".") == 0 ||
strcmp(fileinfo.cFileName, "..") == 0)
continue;
f = (file_t *)malloc(sizeof(file_t));
memcpy(f, &fileinfo, sizeof(fileinfo));
a->push(f);
} while (FindNextFileA(h,&fileinfo) != FALSE);
FindClose(h);
}
return a;
}
"Linus" <linus@linus.cx> wrote in message news:3BF3195C.4C0B@linus.cx...
> Hi folks,
> I tried the example code for the 'findfirst/findnext' functions. It
> works in the DOS/DOSX memory models but built as a WIN32 console app
> 'findfirst' always returns NULL. As there definitely are files present,
> this looks like a bug. Or did I miss something? I don't have the library
> source, so can't check it myself (but like to buy the CD, maybe you can
> arrange something apart from paypal ?).
|
Copyright © 1999-2021 by the D Language Foundation