lua-users home
lua-l archive

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


On 1/27/07, Rob Kendrick <lua-l@nun.org.uk> wrote:
You can't.  At least not directly.  Lua's written in ANSI C, and
therefor does not have a setenv() to go along with getenv()/main()'s
third parameter.

Are there any other builds of Lua that have this functionality built
in. Like LuaX, ect...

You can either bind your OS's setenv-like/spawn-like API calls yourself,

That means I have to maintain the Lua source for my modified version.
Has any talk occurred about adding the setenv() call to the official
release? Is there any tutorial or example on how to add/modify Lua
with this added functionality? I have browsed the Lua wiki and didn't
see any articles about tweaking Lua itself. I know there are the
"Power Patches", just looking for some simpler modification so I can
get my feet wet.

or do the evil thing and generate a shell script/batch file that does
the right thing, and then run that.

That is an idea. I kinda like that. Is there a way to find out what
platform your script is running on?
For example::
if (OS == "linux") then
   -- Do some linux specific output
   ...
else
  -- Do some Windows specific output
   ...
end

Thanks for your help.
--
Regards,
Ryan
RJP Computing