lua-users home
lua-l archive

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


you don't really need that.

just use kepler(ok, I know you said you don't want it
but read on). Build it as usual with the fastcgi
launcher. You should find a fastcgi.so then try this :

#!/your_lua_path/lua
require'fastcgi'
magnet={}
while fastcgi.accept() > 0 do
   file = fastcgi.getenv('PATH_INFO')
   script = magnet[file] or loadfile(file)
   pcall(script, ...)
   if not magnet[file] then magnet[file] = script end
end

and put it to your CGI/FASTCGI directory or whatever
host setup you have.

The code is not tested but hope to give you an idea. 

I use similar code on my dreamhost without any kepler
thing, just the fastcgi.so 

you can also launch it as a CGI instead of fastcgi.

--- Drakas Tralas <drakas.tralas@googlemail.com>
wrote:

> Hello,
> 
> I am trying to assign a file handler to Lua using
> the C interface.
> 
> For some reason, I get a Segmentation fault error at
> :write() method,
> and the debugger shows 'fwrite' as the source of the
> error.
> 
> Can someone show me a good example of this?
> 
> I was trying to integrate into magnet.c of
> http://jan.kneschke.de/projects/lua ; Specifically I
> want ot be able
> to assign FCGI_stdin and FCGI_stdout to Lua so I
> could make a FastCGI
> application.
> 
> And please don't mention the Kepler framework, I
> want something
> lighter than that.
> 
> I searched through this mailing list and found
> exactly what was
> needed, but can't locate it now.
> 
> Thanks for any help :)
> 



       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC