Hi !

A while ago I asked the questions below, and got no answer at all.

Depending on the answer, I was prepared to try sending in 
some patches to help improve Ruby. But now I don't know what to 
do.

/Johan Holmberg


On Sat, 11 Dec 2004, Johan Holmberg wrote:
>
> Hi!
>
> I wonder what the "philosophy" is regarding error handling in file related 
> methods in Ruby. Let me give an example. It is the method
> Kernel.test(?-, ...), i.e. a test to see if two files are hard links
> to the same file:
>
>    $ mkdir subdir
>    $ touch subdir/aaa
>    $ ln subdir/aaa subdir/bbb
>    $
>    $ chmod 0755 subdir
>    $ ruby -e 'p test(?-, *ARGV)' subdir/aaa subdir/bbb
>    true
>    $
>    $ chmod 0 subdir
>    $ ruby -e 'p test(?-, *ARGV)' subdir/aaa subdir/bbb
>    false                    <--- NOTE THIS !!!
>    $
>
> The "problem" with this behaviour is that the files *are* hard links
> but the permissions prevents us from finding that out. I think it
> would be better to get an exception indicating that, instead of
> "lying" to the script.
>
> I suspect that Ruby behaves in this way in several similar situations.
>
> Should this be changed?
> If so, what would be the preferred action?
>
> /Johan Holmberg
>
>