From: David Vallner Date: 2006-02-11T03:17:32+09:00 Subject: Re: Yet another question on exceptions Dňa Piatok 10 Február 2006 18:33 Eric Jacoboni napísal: > "Robert Klemme" writes: > > Btw, your first example is overly complex. This does the same: > > > > File.open("my_file") do |fic| > > fic.puts("bla") > > end > > Actually, i took the habit to always handle exceptions myself, hence > the block begin/rescue... > > Furthermore, it was a toy exemple: i like my scripts exit with > different values for different problems. Well, File.open in the block version will reraise the exception precisely to let you do that, it's not supposed to silently ignore errors. Isn't there a POSIX C header that defines various types of standard error codes for programs to return? In case I'm not imagining things, you might want to look into it and whether we can access those constants from Ruby to do things The Right Way.