Re: Yet another question on exceptions


#1

File.open is not that stupid ;-). It uses “ensure” internally to close
a file in the case of exception. Using block with open guarantees that
the file will not remain open no matter what.

Gennady.