6

Looking at the default Lua cpath with luajit:

luajit -e "print(package.cpath)"

I get:

./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

What is the purpose of the loadall.so? It doesn't actually exist anywhere on my Linux system.

timbo
  • 13,244
  • 8
  • 51
  • 71

1 Answers1

2

The cpath shows you where Lua will look for modules when you "require" a module. It will try the semicolon separated places, replacing "?" with the name of the module being required. loadall.so is a catch-all place, kind of a last resort. If it is present (NB: there is no need for it to present), then Lua will load it and look if it finds the module code in it.

Marc Balmer
  • 1,780
  • 1
  • 11
  • 18