[alexandria-devel] Proposed addition of temporary file creation utilities

Faré fahree at gmail.com
Sun Apr 22 17:31:03 UTC 2012


2012/4/22 Hans Hübner <hans.huebner at gmail.com>:
> 2012/4/22 Faré <fahree at gmail.com>:
>>> I like the portable getenv implementation - Not having that available
>>> is why my proposal uses a logical pathname so that one can define the
>>> temporary directory easily from the outside.
>>>
>> Both asdf and xcvb-driver export getenv.
>
> I am aware of that.  I am lobbying for the inclusion in Alexandria so
> that libraries which need the functionality need not depend on a build
> system for this basic, non build-related functionality.  The idea was
> motivated by work someone does on Postmodern, and even though
> Quicklisp exists, having Postmodern depend on either XCVB or ASDF does
> not seem like The Right Thing.
>
Unless postmodern can be loaded without ASDF,
I don't see a problem with making its dependency on ASDF explicit.
Also, xcvb-driver itself is not a build system (xcvb is), it's a basic runtime,
providing portable abstractions from the underlying system.
XCVB has a strict dependency on xcvb-driver, but the reverse
dependency is looser.
Maybe that would be more obvious if I split its repository from that
of xcvb itself?

>> If you're unwilling to handle non-trivial system dependencies in alexandria,
>> then maybe alexandria is not the place for this particular piece of code.
>> Osicat, iolib (why do we need two such libraries?) might be better suited,
>> or you could use xcvb-driver that exports this piece of functionality.
>
> Neither osicat nor iolib offer portable implementations for temporary
> file name generation.
>
My point is that you should offer a patch to these systems, not to alexandria,
if you are to depend on functionality only these systems can provide
to do the Right Thing(tm) with respect to temporary files.
And if only for security purposes, that seems like a good idea:
if you introducing a potential security issue in a basic library,
that gets inherited implicitly by all innocent users of a poorly
written piece of code,
that's a poor way to promote Lisp as a serious language in which to
write serious software.
I'd rather any widely promoted version of with-temporary-file either use
mkstemp with appropriate defaults for the directory,
or try very hard to behave in a similar fashion to mkostemp with
appropriate defaults.
Unhappily, setting the umask around an otherwise umask-ignorant
with-temporary-file
is not thread-safe.

For well-delimited purposes such as in xcvb-driver, trusting the umask
might be OK,
but for a basic foundational library such as alexandria, I believe
it's inviting disaster.
Please submit an enhancement to iolib or osicat instead of alexandria.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
License Agreement: By reading this message, you agree to run around the room
which you are currently in, flapping your arms, and squawking like a chicken.




More information about the alexandria-devel mailing list