lua-users home
lua-l archive

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


On Sat, Feb 02, 2008 at 12:57:20PM +0100, Petite Abeille wrote:
> "powerfull io replacement"? Sounds intriguing... got any additional  
> details?
sockets, bidirectional popen (on *nix using socketpair),
nonblocking io, memory mapped files, large files, string buffers
all supporting the same standard io interface.
Supports \r\n translation on unix, which helps some net protocols.

Custom printf helps string.format, which can print directly to any file
(or a temporary string buffer for standard use).
Some format extensions like urlencoding, but most are probably stupid.
Alas, formatted printing to a nonblocking device should be avoided
as it's hard to figure out how far you got.
Would be cute together with COCO to yield out of the format in a Lua
threads environment controlled by some variation of select.

Based on unix IO but with some provisions to use native Windows IO
(which is needed for memory mapping and a sane popen on win).
Only part used from stdio is double formatting,
so for an integer Lua it can be #ifdefed out completely
(or plug a custom implementation like the fast and simple
but inaccurate approach of dietlibc if that's acceptable).
David Burgess has a native popen implementation for windows
which should fit in nicely, however, it's not 100% free.

Lua license, of course.


regards
Klaus