Forum: Ruby Re: Yet another question on exceptions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gennady B. (Guest)
on 2006-02-10 18:10
(Received via mailing list)
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.
This topic is locked and can not be replied to.