bug-gnulib
[Top][All Lists]
Advanced

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

Getting a good temporary directory


From: Reuben Thomas
Subject: Getting a good temporary directory
Date: Sun, 23 Sep 2012 20:33:55 +0100

I'm trying to rewrite some code that uses tmpname to use mkstemp.
Unfortunately, I can't see a simple way to get a good location for
temporary files independently of tmpname. P_tmpdir is obsolescent and
optional, and it seems that there's no other POSIX way to get at "the
path commonly known as /tmp".

Looking through gnulib, the closest I can find to what I want is the
code in clean-temp.c, but it appears to be bound up with code for
creating temporary files. This is unfortunate, because my application
is in pure Lua, so I'd have to translate clean-temp.c into Lua to
avoid using C.

I could also add code to the luaposix Lua POSIX bindings library, but
that would have to be pure POSIX and MIT-licensable.

Any suggestions?

(This is yet another problem that would be solved by having a
libgnu.so that I could bind using libffi, BTW! My application, a fork
of GNU Zile, is GPL-licensed.)

-- 
http://rrt.sc3d.org



reply via email to

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