lua-users home
lua-l archive

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


On Sat, 2007-01-27 at 10:13 -0500, RJP Computing wrote:

> How can I change environment variables so that I can then use
> os.execute() to run a program the looks for a specific environment
> variable to be set. (ie. PATH or INCLUDE or LIB) I want to fire off a
> compiler.

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.

You can either bind your OS's setenv-like/spawn-like API calls yourself,
or do the evil thing and generate a shell script/batch file that does
the right thing, and then run that.

B.