guile-user
[Top][All Lists]
Advanced

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

Re: request tmpfile(3) wrapping in Guile 1.9 libguile


From: Ken Raeburn
Subject: Re: request tmpfile(3) wrapping in Guile 1.9 libguile
Date: Mon, 8 Feb 2010 23:36:07 -0500

On Feb 8, 2010, at 12:06, Andy Wingo wrote:
>> But mkstemp doesn't guarantee that no one else will grab the file name
>> in between the time mkstemp checks that the file doesn't exist, and when
>> you actually open(O_CREAT) it.
> 
> It does. The return value from mkstemp! is a port, and it mutates the
> template to give you a file name. See mkstemp(3).

Ah, yes, I was looking at mktemp(3)... *sigh*  Too many similarly-named 
functions.

It looks to me like tmpfile still has the advantage that (at least on a POSIX 
system with local file systems) the file will automatically go away even in the 
event of ungraceful process termination.  You could call unlink from Scheme 
code, but then you're coding the Scheme application to be dependent on POSIX 
behavior, versus letting the Windows version of tmpfile help you out.

Ken



reply via email to

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