Hi all, from the User's Manual: http://www.math.sci.hokudai.ac.jp/~gotoken/ruby/ruby-uguide/uguide25.html ruby> begin ruby| file = open("/tmp/some_file", "w") ruby| # something to do ruby| ensure ruby| file.close ruby| end Let's suppose /tmp/some_file does not exist: then I get, from the ensure part: NameError: undefined method `close' for nil Obviously, as open has failed in opening the file, 'file' references 'nil'... How do we cope with this kind of things? file.close unless file.nil? (is there any way of catching that before the ensure clause?) thanks, d@ PS- The documentation is great, and the library reference is superb, but many manuals, etc, are lagging behind the code... most are for ruby 1.4... eg. I saw an 'include Singleton' somewhere to create a singleton class, where in 1.4 that was done with 'class << single'. Is there any updated documents like the Reference Manual for 1.4 updated? While I still love _The Pragmatic Programmer_ by Dave and Andy, even after some 100 readings, at the current Euro rate, getting the Ruby book is off the question by now... thn ---------------------------------------------------------------------- + Mensaje enviado gracias al correo gratuito de Desmasiado Corp. + + http://correo.demasiado.com + ----------------------------------------------------------------------