[GRASS5] snprintf and other compile errors on IRIX

Carl Worth cworth at east.isi.edu
Fri May 3 05:19:01 EDT 2002


On May 2, Eric G. Miller wrote:
 > Comments welcome (I'm not too
 > sure tmpfile() is safe.  It's apparently an anonymous file on my
 > machine, as nothing shows up in /tmp or the current directory...)

tmpfile may be implemented by opening the file, then immediately
unlinking it. The process that retains the open file handle can
continue to use it until that file handle is closed, (at which point
the file is then actually removed). This could explain why you never
actually see any file created.

This is a great way to ensure that the file always gets removed
without the programmer having to do anything extra to say that the
file is no longer needed. Even if the program crashes, all open file
handles will be closed so the cleanup always occurs.

Incidentally, there was some recent discussion about getting GRASS
temporary files cleaned up more consistently. Moving to tmpfile where
possible might be just the thing to do.

-Carl

-- 
Carl Worth                                        
USC Information Sciences Institute                 cworth at east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203		  703-812-3725



More information about the grass-dev mailing list