diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 09:40:41 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 09:40:41 +0000 |
commit | a968bd2efb93595c625ca124d3b6f18f525f5814 (patch) | |
tree | 0289319f36226f230951dd2a0af77c05c2c7db21 /win32/win32.c | |
parent | 7aae3bd3c37b3f399aa55325a37c8428e5981e2d (diff) | |
download | ruby-a968bd2efb93595c625ca124d3b6f18f525f5814.tar.gz ruby-a968bd2efb93595c625ca124d3b6f18f525f5814.tar.xz ruby-a968bd2efb93595c625ca124d3b6f18f525f5814.zip |
merges r25092 from trunk into ruby_1_9_1.
--
* 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/branches/ruby_1_9_1@26017 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 0f60dcd7a..345fcdd15 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3648,6 +3648,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) { |