Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: Ricardo_V on December 28, 2007, 10:45:41 PM

Title: struct stat error
Post by: Ricardo_V on December 28, 2007, 10:45:41 PM
Hello, I am developing a PocketPC app and I have to check if a given file exist. The function I use is:
Code: [Select]
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.
Title: Re: struct stat error
Post by: TimoVJL on December 29, 2007, 01:16:20 PM
Use GetFileAttributesW function instead.
Title: Re: struct stat error
Post by: Ricardo_V on December 30, 2007, 11:05:20 PM
Use GetFileAttributesW function instead.
Thanks, that means stat won't work at all?