I've noticed that some function packages make use of "home-made"
functions to create a temporary file in the user's dotdir. These
probably work fine in most cases, but they're not safe against race
conditions and I thought we should have a "proper" way of doing the
job.
That's now provided by outfile. You say
outfile foo --tempfile
where "foo" is either the name of an existing string variable or a
valid hansl identifier that's not yet used for any object.
The outcome is that a file is created in dotdir using the safe
C-library function mkstemp(), and its name is written into foo
(which is created if it doesn't already exist).
<hansl>
string foo # declaration optional
outfile foo --tempfile
# do stuff ...
end outfile
printf "Output went to %s\n", foo
printf "Content is\n%s\n", readfile(foo)
</hansl>
Allin