nmh-workers
[Top] [All Lists]

[Nmh-workers] tempfile creation

2005-04-27 07:15:10
 
it seems that the usual paradigm in the nmh code (i'm looking at 1.1
source) for creating a temp file is to do something like this, from
mhbuild.c:

        /* copy standard input to temporary file */
        strncpy (infile, m_scratch ("", invo_name), sizeof(infile));
        if ((fp = fopen (infile, "w")) == NULL)
            adios (infile, "unable to open");

invo_name at this point is "mhbuild".  m_scratch() adds some
randomness (via mktemp()), and opens the file.

a) i'm surprised the transition to mkstemp hasn't happened.  this
may feed into the reasons behind b), which is that since there's
no path associated with the temp file name, it's created in the
current directory.  if i don't happen to have write permission
there, mhbuild fails.  why aren't tempfiles created in /tmp?

paul
=---------------------
 paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 48.7 degrees)


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>