It gets unhappy if findData is on the stack. Make it a global and it works ok. I found this out by trial and error. I have no idea why it works this way.
that function now succeeds... the first file it returns is '.' .. then i call the function again, and it returns 0 (no more files?) ..
the directory is definately populated.. and i can open files and read them directly.. they just dont seem to show in the directory listing.. :/
an interesting behaviour i found is, if i search on a path with a '/' on the end, the file it finds is named '.' .. if i search on a path without the '/' .. the file it returns is named '/.' .. this seems weird to me ... i'll keep playing with it..
Interesting you say that, because you are able to use the same buffer over and over again with only setting dir.file[0]='\0' (emptying the filename) without memsets in between, but that doesn't work on its own.
Just luck I suppose.