lua-users home
lua-l archive

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


>I am _very_ new to Lua (I'd never heard of it before today) and I find
>myself needing to write a Lua script for a project I'm working on.

Welcome!

>I need to be able to move a fairly large amount of data from within a Lua
>script to the "outside" world where I can deal with it using another
>program.  The only way I know to do this is by constructing a shared
>memory segment.

If I understand you correctly, all you need to do is to export a C function
to Lua that writes to the shared memory segment. You'll need to work in C
to setup this shared memory segment. The C function exported to Lua would
get a Lua string and an offset into the shared memory segment and simply
copy the Lua string to that position. Note that Lua string can hold arbitrary
binary data.

--lhf