[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Location of a package
- From: Fabien <fleutot+lua@...>
- Date: Mon, 18 Feb 2008 21:10:33 +0100
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.