From: Ara.T.Howard@... Date: 2004-10-09T11:54:44+09:00 Subject: Re: TempFile On Sat, 9 Oct 2004, Matt Maycock wrote: > [ummaycoc@localhost ummaycoc]$ ruby -v > ruby 1.8.2 (2004-06-21) [i686-linux] > > I have an issue with tempfile. I'm going through a loop which creates > two temp files, writes data, uses them to generate graphs (wonderful > gnuplot), and then destroys them. Sometime after a few > iterations(sometimes 4, sometimes 100, sometimes not at all [once]), I > get to a point where I need to use the contents of the tempfile, and > the file is not there! I've done nothing to erase the file. It's > sorta nondeterministic. If I hit `up' in bash and rexecute my ruby > -ne line, I get the same problem with the same iteration at the same > point in my code. If I `change' any line in a file involved with the > process (my gnuplot wrapper, some random file that gets included) - it > can change where in the code and what iteration - even if the change > is equiv to `touch #{file}` > > I can post code if anyone wants to wade through my mess, but I don't > think it's a `me' issue (ie not my fault -- at least I hope :-) > > Any similar experiences / advice? > > ~Me! probably one of two things could be happening: a) your process forks and the exiting child calls exit, not exit!, and removes the file. b) you are calling close! not close, on the tempfiles. any chance of either of those happening? -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================