On Aug 15, 2006, at 1:21 AM, nobu / ruby-lang.org wrote:

>> While running "sudo make install-doc" on Mac OS X 10.4.7, I
>> got a nastygram about '.' not being readable.  I was able to
>> get around this by opening up the permissions on the current
>> directory (it was mode 750; I made it 755), but I can't see
>> why this should matter.
>
> What's the exact message?

I just found it...

% touch blah.txt
% chmod 700 blah.txt
% ruby -e 's=File.stat "blah.txt"; p [File.readable?("blah.txt"),  
s.readable?]'
[true, true]
% sudo ruby -e 's=File.stat "blah.txt"; p [File.readable? 
("blah.txt"), s.readable?]'
[true, false]

the last bool is our culprit and is the difference between:

     if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse;

versus:

#ifdef S_IROTH
     if (!(st->st_mode & S_IROTH)) return Qfalse;
#endif

I can patch the rdoc options processing code to make it work  
regardless, but I'd like some eyeballs on the difference between the  
two. Is this a documentation problem or an implementation problem?

514 % ri File::Stat.readable?
--------------------------------------------------- File::Stat#readable?
      stat.readable?    => true or false
------------------------------------------------------------------------
      Returns +true+ if _stat_ is readable by the effective user id of
      this process.

         File.stat("testfile").readable?   #=> true

515 % ri File.readable?
-------------------------------------------------------- File::readable?
      File.readable?(file_name)   => true or false
------------------------------------------------------------------------
      Returns +true+ if the named file is readable by the effective user
      id of this process.