12 WIN32_FIND_DATA find_data;
16 DIR *opendir (const char *name)
18 char fullName[MAX_PATH+1];
19 DIR *dd = malloc (sizeof(*dd));
23 strcpy (fullName, name);
24 strcat (fullName, "\\*.*");
25 dd->handle = FindFirstFile(fullName, &dd->find_data);
29 struct dirent *readdir (DIR *dd)
31 if (dd->handle == INVALID_HANDLE_VALUE)
33 strcpy (dd->entry.d_name, dd->find_data.cFileName);
34 if (!FindNextFile(dd->handle, &dd->find_data))
36 FindClose (dd->handle);
37 dd->handle = INVALID_HANDLE_VALUE;
42 void closedir(DIR *dd)
44 if (dd->handle != INVALID_HANDLE_VALUE)
45 FindClose (dd->handle);