Calling File.read( ) from rails


#1

I was looking at the encryption logic posted

http://blog.leetsoft.com/2006/03/14/simple-encryption

and http://blog.leetsoft.com/files/crypto-key.rb.txt

there is a call made to File.read( ) to open up RSA keys.
THe question is:
Does this result in an automatic closure of the file after it is
read???

Or… if not should I do a File.open(), perform my logic, and then
explicitly do a File.close() or wrap it in a block to close?

Concerned about a File descriptor leak.


#2

DavidB wrote:

there is a call made to File.read( ) to open up RSA keys.
THe question is: Does this result in an automatic closure of the file after it is read???

http://www.ruby-doc.org/core/classes/IO.html#M002297

Estamos de estreno… si necesitas llevar el control de tus gastos
visita http://www.gastosgem.com !!Es gratis!!


#3

Javier,
Unbelievable-thanks for finding that. I thought I had scoured the API.
Thanks again.
David