Temporary files in GraphicsMagick

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <Pine.GSO.4.44.0303231410090.14868-100000@scooby.simplesystems.org>
I am planning to implement a temporary file management subsystem in
GraphicsMagick similar to what I described on the gm-core list
yesterday.

Rather than requiring that code thoughout GraphicsMagick manage its
own temporary files, temporary file access will be via a temporary
file allocation subsystem which keeps track of the temporary files
which have been allocated, and assures that they are all removed if
GraphicsMagick is still capable of making an orderly exit (a "kill -9"
or any other uncatchable signal/exception can still leak files).

I am planning to use mkstemp() (where available) to allocate the
temporary file in order to improve security (the current approach is
subject to race-conditions).  Functions will be available to simply
obtain a temporary file name, return an integer file number, or return
a stdio FILE handle.  When a temporary file is requested, it will be
created on disk as either empty, or with known content.  This means
that when a temporary file is specified as the output target for a
delegate, that testing for the existence of the file will no longer be
sufficient to see if the delegate succeeded.  A function will be
provided to see if the temporary file exists and contains non-default
content.

Bob
======================================
Bob Friesenhahn
[email protected]
http://www.simplesystems.org/users/bfriesen




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.