struct stat error

Started by Ricardo_V, December 28, 2007, 10:45:41 PM

Previous topic - Next topic

Ricardo_V

Hello, I am developing a PocketPC app and I have to check if a given file exist. The function I use is:
int ArchivoExiste (char * fileName) {
struct stat buf;

int i = stat(fileName, &buf);
if (i==0) // found
return 1;
return 0;
}


but after compiling I get:

C:\....\main.c(18): error #2149: Undefined size for 'buf' with type '[incomplete] struct stat'.
C:\....\main.c(20): warning #2027: Missing prototype for 'stat'.
*** Error code: 1 ***
Done.

Of coures I included <sys/stat.h>. What am I doing wrong , or stat does not work for pocketPC?

Thanks in advance.

TimoVJL

Use GetFileAttributesW function instead.
May the source be with you

Ricardo_V

Quote from: timovjl on December 29, 2007, 01:16:20 PM
Use GetFileAttributesW function instead.
Thanks, that means stat won't work at all?