lua-users home
lua-l archive

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


On Sat, 15 Apr 2006, Lisa Parratt wrote:

Why not use neither, and implement a nice predictable function that does exactly what you want, rather than relying on the highly unreliable "standard" C library?

The C libraries in use on most desktop platforms are mature and reliable. (If they contain bugs, report them and yea verily they shall be fixed, although I realise this doesn't help immediately.) If you're using an embedded system, you can often replace the vendor's C library (and/or entire toolchain) with something tried and tested like dietlibc or ulibc. Prefer vendors who ship source, so you can fix rather than kludge.

Besides, mkstemp is something one is unlikely ever to implement (or even worse, use) correctly, at least on a multi-tasking system. Creating temporary files is a hard problem, as witness the number of different functions for doing so on a typical POSIX-based system. Creating a temporary filename without a file is simply not possible on such systems: you always have a race condition.

Personally, I'd rather the Lua authors concentrated on providing a programming language than an OS, and I suspect in any case that's what they're going to do. Lua's using and not reimplementing the standard[1] C library is one reason it's so versatile.

Reuben

[1] I assume your quotation of "standard" is meant to mean that many libcs are not, not that there is no standard, right? :)

--
http://rrt.sc3d.org/ | robber, n.  a candid man of affairs (Bierce)