lua-users home
lua-l archive

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

I have a gz filter(.c) that adds to luasocket.
It was built to avoid the memory blowout.
If you want it, mail me directly.


On 30/3/2010 1:42 AM, Natanael Copa wrote:

So, I have this code:

f = io.popen("wget -q -O - "..gzurl.." | gunzip -c")
for line in f:lines() do
     -- process line here

Clean, and simple. Not so beautiful. So i thought I'd have a look at
lzlib and luasocket to do the same. I'd expect something in the lines:

s =
f = zlib.inflate(s)
for line in f:lines()
    -- process line here

But thats obviously not how socket.http works. I need sinks, and
chains and pumps? I cannot even use socket.tcp for this which does not
give me a "file handle" either.

Any one have a link to an example how to do things like that?

One key point here is that the memory is limited and file is big so i
cannot download entire file to ram and process it afterwards. (And I
also want use the time waiting for data over slow lines doing
something useful)