lua-users home
lua-l archive

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


On Friday 05 August 2005 5:06 am, Mukhsein Johari wrote:
> Thanks, I guess I don't fully understand the path searching thing. For
> some reason, I always thought that any local lua files would simply
> overide the system versions. eg. the following env var:
>
> LUA_PATH="/usr/local/share/lua/5.0/?.lua;/usr/local/share/lua/5.0/?/?.lua;.
>/?.lua"
>
> Means that even if there's a local version  ./mymodule.lua, it won't
> overide the systemwide /usr/local/share/lua/5.0/mymodule.lua (if it
> existed). Is this correct?

simply put, the LUA_PATH is a list of directories to search, separated by 
semicolons ';' .  the first part that matches will be used.  in your example, 
the 'systemwide' part is before the 'local' part.  this is convenient for 
tightly administered settings; but a developer would prefer to have it 
reversed:

./?.lua;./?/?.lua;/usr/local/share/lua/5.0/?.lua;/usr/local/share/lua/5.0/?/?.lua

this way, the local ./?.lua;./?/?.lua parts would come before global ones

-- 
Javier

Attachment: pgpgyVC1PBetW.pgp
Description: PGP signature