hello,

i am new to gnuwin32. i am trying to compile a test program from glibc that
uses scandir. i compiled it with:
gcc scandirtst.c -I/c/Program\ Files/GnuWin32/include/glibc/  /c/Program\
Files/GnuWin32/lib/libgw32c.a -lole32 -luuid -o scandirtst

it produced an exe file but the result was blank. here is the output
$ ../scandirtst.exe 
found , len 0
found , len 0
found , len 0
found , len 0
found , len 0
found , len 0
found , len 0

please let me know if i did something wrong. this is the source:
#include <stdio.h>
#include <dirent.h>

int one(const struct dirent *unused)
{
        return 1;
}

int main(void)
{
        struct dirent **eps;
        int n;

        n = scandir("./", &eps, one, alphasort);
        if (n >= 0) {
                int cnt;
                for (cnt = 0; cnt < n; ++cnt) {
                        char *name = eps[cnt]->d_name;
                        printf("found %s, len %d\n", name, strlen(name));
                }
        } else
                perror("Couldn't open the directory");

        return 0;
}





       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
http://autos.yahoo.com/carfinder/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users

Reply via email to