Erik Hollensbe
6/4/2006 10:53:00 AM
On 2006-06-01 07:05:12 -0700, lemontree75@gmail.com said:
> 1) No info about exceptions concerning File.read
> 2) Actually I cannot establish where File.read comes from
> 3) Errno::EACCES... What's that?!?! It is the name of the raised
> exception that I catch with the rescue keyword. It works but
> Errno::EACCES doesn't appear anywhere in the documentation!!!
(This could be slightly incorrect, but is useful for the purpose of
this discussion. I'd love to hear how this /actually/ works in ruby.)
File (and consequently IO) exceptions are not really exceptions, but
mirrored from the constants from 'errno.h', which is normally in
/usr/include. If you're on a windows system, it's somewhere in your
stdlib include path.
If you're on a unix machine, you can type 'man 2 open' to get a list of
these constants and what they mean.
From the manual (OS X 10.4):
[EACCES] Search permission is denied for a component of the
path prefix.
[EACCES] The required permissions (for reading and/or writing)
are denied for the given flags.
[EACCES] O_CREAT is specified, the file does not exist, and the
directory in which it is to be created does not permit
writing.