Created
February 15, 2009 07:52
-
-
Save maiha/64642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% mkdir -p a/foo b | |
% touch b/foo | |
% ls -ld a/* b/* | |
drwxr-xr-x 2 maiha maiha 4096 Feb 15 16:40 a/foo/ | |
-rw-r--r-- 1 maiha maiha 0 Feb 15 16:40 b/foo | |
% ruby1.9 -Ia -Ib -e 'load "foo"' | |
-e:1:in `load': Is a directory - /data/home/maiha/load-test/a/foo (Errno::EISDIR) | |
from -e:1:in `<main>' | |
# this occurred in Ubuntu that has "eaccess" system call | |
# OSX is free from the bug because it has not that system call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int | |
file_load_ok(const char *path) | |
{ | |
return eaccess(path, R_OK) == 0 && rb_file_file_p(Qnil, rb_str_new2(path)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ruby1.9 --version | |
ruby 1.9.1p0 (2009-01-30 revision 1234567890) [i686-linux] | |
# revision is modified :) | |
% ruby1.9 -Ia -Ib -e 'load "foo"' | |
# no errors!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment