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

Re: [Dev-luatex] mkstemp or similar in lua(tex)



Hi Hans!

On Sa, 17 Nov 2007, Hans Hagen wrote:
> maybe it opens a file just to be sure that the name is indeed reserved 
> an dnot taken by another process in tne meantime, so os.tmpdir() is 

Yes, otherwise it would be racy, some other process could make a symlink
attack whatever you have in your home dir.

> needed; i wonder, maybe it makse sense to accept an optional argument 
> that for the root so that one can generate a tmpdir at a specific 
> location i.e. tmpdir("/tmp") or so

	mkstemp and mkdtemp (section 3)

allow for templates. Or the shell function

	mktemp

allows for templates and creation of dirs/files.

But are mkdtemp and mkstemp available everywhere we want to compile
luatex?

The man page of mkdtemp(3) is not very inviting:
   VERSIONS
       Available since glibc 2.1.91.


Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>        Vienna University of Technology
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BOOTHBY GRAFFOE
1. The man in the pub who slaps people on the back as if they were old
   friends, when in fact he has no friends, largely on account of this
   habit. 2. Any story told by Robert Morley on chat shows.
			--- Douglas Adams, The Meaning of Liff



Reply to: