Secure Coding mailing list archives

temporary directories


From: mouse at Rodents.Montreal.QC.CA (der Mouse)
Date: Sat, 30 Dec 2006 00:58:08 -0500 (EST)

But for a temporary file, I will specify a file that is not in any
directory.  I presume there is such a capbility in Unix.
You presume incorrectly.

Yes and no.

Unix does have files that do not have names in any directory.  What it
does not have is creation of such files without the existence (even
transiently) of any name for them.

To the extent that "Unix" is a single thing, that is.  It wouldn't
surprise me if some Unix variants had a way to do this.  (If you're
willing to accept a name in a directory which does not have a name
anywhere except for its own ".", many of them do.)

You're talking about VMS, where you can open a file by file id.  The
Unix analogue of a file id is an inode number, but no user-land call
exists to access a file that way.

On many Unix variants, such a call does exist.  See NetBSD's (and
probably others') fhopen, for example.  It's restricted to root, but it
exists.

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML               mouse at rodents.montreal.qc.ca
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Current thread: