lua-users home
lua-l archive

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

On Mon, Feb 8, 2010 at 3:25 PM, Joe Andresen <> wrote:
> is it possible to require all give modules in a path without knowing their
> names?
> Will this work with subdirectories of that path as well? or does that have
> to be included in package.path?

Lua simply appends the module name to each path and then tries to open
the file. It has no concept of a directory so it cannot iterate over
the files in a directory for modules to load.

On the other hand, you can construct LUA_INIT so that it requires all
modules in a directory with some fancy bash code (an exercise left to
the reader).

- Patrick Donnelly