lua-users home
lua-l archive

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


It's unfortunate that the package finder function isn't exposed in Lua by the native package lib. I hope it will be done
in Lua 5.2.

Metalua needs it, and reimplements it. Look at function package.findfile() in
http://repo.or.cz/w/metalua.git?a=blob_plain;f=src/lib/package2.lua, and give it your package's name as first arg,
package.cpath or package.path as a second arg, depending on whether your module is in C or in Lua. Don't
forget to close the file handle if you don't use it.

-- Fabien.