lua-users home
lua-l archive

Re: extending lua load path

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


于 2011年11月15日 1:56, Duncan Cross 写道:
On Mon, Nov 14, 2011 at 4:47 PM, Oliver Mueller
<oliver.mueller@gmail.com> wrote:
The load paths are taken from package.path - it is a
semicolon-separated string, where a question mark is used to
interpolate the package name. So, to look for modules inside the
'scripts/' folder, do this before any calls to require():
 package.path = package.path .. ';scripts/?.lua'
-Duncan
just to mention, that the seperator/delimiter/placeholder of `package.path' is configurable,
not guaranteed to be semicolon or question mark.
refer to `package.config' and `luaconf.h' for details.

AltStyle によって変換されたページ (->オリジナル) /