diff options
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index 1d6a4a68e4..353873a22b 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4054,6 +4054,20 @@ rb_w32_stati64(const char *path, struct stati64 *st) return ret; } +int +rb_w32_access(const char *path, int mode) +{ + struct stati64 stat; + if (rb_w32_stati64(path, &stat) != 0) + return -1; + mode <<= 6; + if ((stat.st_mode & mode) != mode) { + errno = EACCES; + return -1; + } + return 0; +} + static int rb_chsize(HANDLE h, off_t size) { |