On Mon, Jun 20, 2005 at 10:00:34AM -0400, Jason Tackaberry wrote:
> On Mon, 2005-06-20 at 13:24 +0200, Dirk Meyer wrote:
> > Is there a reason why you didn't use mkstemp?
> 
> Well, you can't use mkstemp to create a shared memory object, so I
> needed code to create a suitably random filename anyway.  For the
> filesystem fallback, I already had the random name, and didn't really
> need to use mkstemp.  I open the files with O_EXCL, which is all the
> mkstemp does as well.
> 
> The only benefit I think we get over mkstemp is that it first checks for
> the existence of the random name, and if it exists, it tries again until
> it finds one that doesn't exist.  But in practice, the probability of
> this happening is low, unless it's under attack, in which case it will
> just fail and raise an IOError in python space.

The mkstemp manpage on Debian linux suggests that you should use
tmpfile() instead btw -- You get a FILE * back rather than a file
descriptor.

Phil

-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to