< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
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