lua-users home
lua-l archive

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


On Fri, 12 Mar 2010, Gaspard Bucher wrote:

> Since we are on the subject, is there a way to have multiple values for
> lua's cpath like $PATH (/usr/local/lib:.:~/classes) ?

Not that we're on the subject, but anyway... :)

The separator is a semicolon and not a colon, and the entries aren't 
really paths, but rather patterns where the character ? is replaced 
with the name of the module being required.

For instance, on my system package.cpath looks like this:

$ lua -e 'print(package.cpath)'
./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

Cheers,

Joonas