Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/64642 to your computer and use it in GitHub Desktop.
Save maiha/64642 to your computer and use it in GitHub Desktop.
% 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
static int
file_load_ok(const char *path)
{
return eaccess(path, R_OK) == 0 && rb_file_file_p(Qnil, rb_str_new2(path));
}
% 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