So I'm going to create an object that wraps a file and gives it some new kind of
functionality.

The use of it will basically want to be to init it, ask it if it is eof?, ask it
to do next(). 

I'd like to set the thing up so that no matter how badly things blow up "up
above", the file gets closed. I can see that I could do that with the block
trick like the one on File.open, but I'm not sure I can limit the usage of the
object that extremely.

So what's the cool Ruby way to set this object up to finalize at appropriate
times? I need to deal with exceptions and, I suppose, just never calling back
and ultimately getting the thing garbage collected.

Short pointers to The Text will be fine ...

Thanks!

Ronald E Jeffries
http://www.XProgramming.com
http://www.objectmentor.com
I'm giving the best advice I have. You get to decide whether it's true for you.