NO

Author Topic: struct stat error  (Read 4079 times)

Ricardo_V

  • Guest
struct stat error
« 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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: struct stat error
« Reply #1 on: December 29, 2007, 01:16:20 PM »
Use GetFileAttributesW function instead.
May the source be with you

Ricardo_V

  • Guest
Re: struct stat error
« Reply #2 on: December 30, 2007, 11:05:20 PM »
Use GetFileAttributesW function instead.
Thanks, that means stat won't work at all?