On Mon, Apr 03, 2006 at 09:56:27AM -0400, Aaron M. Ucko wrote: > Yes. tempfile(1) specifically states > > The directory to place the file is searched for in the following order: > > a) The directory specified by the environment variable TMPDIR, if > it is writable. > > b) The directory specified by the --directory argument, if given. > > c) The directory /tmp. > > which I interpret to mean that if TMPDIR is *not* writable, it should > ignore the variable's setting and honor the --directory argument if > given, and fall back to /tmp if it must. I'd favor similar semantics > for mktemp.
The man page text was probably copied from some documentation or comment about tempnam(), which does not actually behave in that way. I've filed a bug in glibc's bugzilla to see what Ulrich's opinion is on the proper behavior of tempnam(), and if that function should be checking the directory permissions, there will be no need to work around it in tempfile. http://sourceware.org/bugzilla/show_bug.cgi?id=4588 In the meantime I should probably correct the man page to refer to tempnam(3). -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

