diff --git a/contrib/win32/win32compat/fileio.c b/contrib/win32/win32compat/fileio.c index 14521fa..970b550 100644 --- a/contrib/win32/win32compat/fileio.c +++ b/contrib/win32/win32compat/fileio.c @@ -499,6 +499,11 @@ fileio_fstat(struct w32_io* pio, struct _stat64 *buf) { return _fstat64(fd, buf); } +int +fileio_stat(const char *path, struct _stat64 *buf) { + return _stat64(path, buf); +} + /* isatty() implementation */ int fileio_isatty(struct w32_io* pio) { diff --git a/contrib/win32/win32compat/inc/w32posix.h b/contrib/win32/win32compat/inc/w32posix.h index 07f964e..8ab9282 100644 --- a/contrib/win32/win32compat/inc/w32posix.h +++ b/contrib/win32/win32compat/inc/w32posix.h @@ -40,12 +40,15 @@ int w32_socketpair(int domain, int type, int sv[2]); /*non-network (file) i/o*/ #define fdopen(a,b) w32_fdopen((a), (b)) #define fstat(a,b) w32_fstat((a), (b)) +//#define stat(a,b) w32_stat((a), (b)) +struct w32_stat; int w32_pipe(int *pfds); int w32_open(const char *pathname, int flags, ...); int w32_read(int fd, void *dst, unsigned int max); int w32_write(int fd, const void *buf, unsigned int max); int w32_fstat(int fd, struct w32_stat *buf); +int w32_stat(const char *path, struct w32_stat *buf); int w32_isatty(int fd); FILE* w32_fdopen(int fd, const char *mode); diff --git a/contrib/win32/win32compat/w32fd.c b/contrib/win32/win32compat/w32fd.c index 1e9b9f0..61bbe56 100644 --- a/contrib/win32/win32compat/w32fd.c +++ b/contrib/win32/win32compat/w32fd.c @@ -349,6 +349,11 @@ w32_fstat(int fd, struct w32_stat *buf) { return fileio_fstat(fd_table.w32_ios[fd], (struct _stat64*)buf); } +int +w32_stat(const char *path, struct w32_stat *buf) { + return fileio_stat(path, (struct _stat64*)buf); +} + int w32_isatty(int fd) { if ((fd < 0) || (fd > MAX_FDS - 1) || fd_table.w32_ios[fd] == NULL) { diff --git a/contrib/win32/win32compat/w32fd.h b/contrib/win32/win32compat/w32fd.h index 12d3f09..995cbe8 100644 --- a/contrib/win32/win32compat/w32fd.h +++ b/contrib/win32/win32compat/w32fd.h @@ -114,6 +114,7 @@ struct w32_io* fileio_open(const char *pathname, int flags, int mode); int fileio_read(struct w32_io* pio, void *dst, unsigned int max); int fileio_write(struct w32_io* pio, const void *buf, unsigned int max); int fileio_fstat(struct w32_io* pio, struct _stat64 *buf); +int fileio_stat(const char *path, struct _stat64 *buf); int fileio_isatty(struct w32_io* pio); FILE* fileio_fdopen(struct w32_io* pio, const char *mode);