diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-25 07:04:25 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-25 07:04:25 +0000 |
commit | bc21ed293f36bf36763b2384432ca06cab4d983c (patch) | |
tree | 4eda581d47a1554319f661107614e12083c4927c /win32/win32.c | |
parent | 9c01b5e3a1c96642d3cb5bf0ef0f8989eb005fdc (diff) | |
download | ruby-bc21ed293f36bf36763b2384432ca06cab4d983c.tar.gz ruby-bc21ed293f36bf36763b2384432ca06cab4d983c.tar.xz ruby-bc21ed293f36bf36763b2384432ca06cab4d983c.zip |
* win32/win32.c, include/ruby/win32.h (rb_w32_access): new function to
replace MSVCRT's access().
[ruby-core:25761]
* file.c (eaccess): workaround for recent MSVCRT is no longer needed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 1d6a4a68e..353873a22 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) { |