PDA

View Full Version : Additional LUA Files in a directory other than the CCF directory



marketability
June 20th, 2009, 02:19 AM
Is there a way to call LUA files from a specified location that ISN'T the CCF or NR directory, eg.



require ('\\\\littlepig\\Documents\\LUAShared\\hardware_li stmanager')


I'm trying to create a central LUA store that multiple NR clients can "share"

Cheers

Rob H
June 20th, 2009, 09:35 AM
You can add a LUA_PATH environment variable or specify a Lua variable called LUA_PATH and that will be searched for any required sources.

If that isn't mentioned in the help then check http://www.lua.org/manual/5.0/

marketability
June 20th, 2009, 12:46 PM
Thanks rob
couldn't find it in the Chm (but that doesn't mean it's not there :-)

marketability
June 21st, 2009, 05:28 AM
Couldn't seem to get LUA_PATH to return anything other than nil but the following seems to work



package.path = package.path..";".."\\\\LITTLEPIG\\Documents\\LUAShared//?.lua"

Rob H
June 21st, 2009, 05:51 AM
Yes, that makes sense, although the environment variable approach should work too.