[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] tempfile creation

From: Paul Fox
Subject: [Nmh-workers] tempfile creation
Date: Wed, 27 Apr 2005 09:50:25 -0400

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

        /* 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 fox, address@hidden (arlington, ma, where it's 48.7 degrees)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]