From: Albert Schlef Date: 2010-03-05T13:22:40+09:00 Subject: Re: A gem for handling temporary file(s)? Robert Klemme wrote: > 2010/3/4 Albert Schlef : >> dot ... -Tgif -o ... -Tsvg -o ... [...] > Btw, do you need to read those files while they are written or is it > sufficient to wait for process termination (e.e. use system) before > you access them? (I read the files after termination (I'm using system()).) >> Maybe I could add some code to the >> "destructor" of my class to explicitly delete these files. Does Ruby >> support "destructors"? > > We have > > begin > ... > ensure > ... > end > > The usual way to do this is to write a method. See > http://blog.rubybestpractices.com/posts/rklemme/002_Writing_Block_Methods.html Thanks. I know this scheme (and the article), but for some reason it didn't come up to my mind to use it. You just gave me a nice idea. I need to read more Ruby code to train myself. The problem is that I love to program so I prefer writing to reading :-( Caleb Clausen wrote: > It's not (just) a robustness issue, but a security issue. Even if > there's not much chance for a race condition, that can create a very > large security hole. I'd suggest you should take a look at the link I > posted in reply to Robert above. I just want to make sure you're > aware. You mean a privacy issue. Yes, I fixed that. Thanks. -- Posted via http://www.ruby-forum.com/.