diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-15 07:16:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-15 07:16:46 +0000 |
commit | b4ef6af8eb2ec7060f79952081ac8a606577183f (patch) | |
tree | 2870849072a483410adcbb8a77457a0c2b8c5e67 /file.c | |
parent | bc8394af95ba924dc9c5ed9f9419a4ad993f7c80 (diff) | |
download | ruby-b4ef6af8eb2ec7060f79952081ac8a606577183f.tar.gz ruby-b4ef6af8eb2ec7060f79952081ac8a606577183f.tar.xz ruby-b4ef6af8eb2ec7060f79952081ac8a606577183f.zip |
* file.c (file_load_ok): use eaccess() instead of actually opening
the file. [ruby-talk:156378]
* lib/jcode.rb (String::reverse): add new methods.
[ruby-list:41245]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -3954,15 +3954,9 @@ is_macos_native_path(const char *path) #endif static int -file_load_ok(const char *file) +file_load_ok(const char *path) { - FILE *f; - - if (!file) return 0; - f = fopen(file, "r"); - if (f == NULL) return 0; - fclose(f); - return 1; + return eaccess(path, R_OK); } extern VALUE rb_load_path; |