Janus wrote:
> hi there,
>
> i have the problem some others had before me: fl_filename_list() will
> count the number of files correctly but does not return pointers to the
> actual filenames, i get random data instead.
Show us your code?
By your description, I'm wondering if your code is treating
the dlist returned as a string array instead of a dirent array.
I've never used this function before, but I whipped this short
example together, and it seemed to work on the first shot:
#include <stdio.h>
#include <FL/filename.H>
int main() {
const char *dirname = "/usr";
dirent **dlist;
int total = fl_filename_list(dirname, &dlist, fl_alphasort);
for ( int t=0; t<total; t++ ) {
printf("%d) '%s'\n", t, dlist[t]->d_name);
}
fl_filename_free_list(&dlist, total);
return(0);
}
Assuming this code is correct, it would probably be good if
it were an example in the docs for this function.
I can add it, assuming it's correct on all platforms.
I only tested this on snowlep.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk