lua-users home
lua-l archive

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


On 18 Jun 2014, at 13:39, Lars Ruoff <lars.ruoff@gmail.com> wrote:

> So how do i tell the Lua environment where to start searching for files when it encounters "require" in scripts?

Lua offers a massive amount of customisation in this regard

Initially I would look into the package.path variable

However, your could also consider preloading everything into package.preload, or writing a custom searcher and placing it in package.searchers.

> I hope this can be set by lua_state individually, since i will be loading several Lua scripts in parallel, each based in a different directory.


Yes, this is configurable per state.

Thanks,
Kevin