lua-users home
lua-l archive

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


>  	Then, if a package doesn't have module "a", it will fail to
> load.  A real case is LuaSQL: it is installed as a unique dynamic library,
> inside directory luasql (in "cpath").  Now it will have another file
> which will be installed in another directory tree ("path").  In a Unix box:
> 
> /usr/local/lib/lua/5.1/luasql/driver.so
> /usr/local/share/lua/5.1/luasql.lua (or luasql/init.lua)
> 
>  	Am I correct?

Not quite. In our view that complete separation of paths between C
modules and Lua modules does not make sense when a single package uses
both. (After all, one of the main ideas of packages is to keep all its
files together.)  So we also changed the default Lua path (forgot to
mention ;) to include the C path (with proper extensions). All you
have to do to correct luasql is to add a file "init.lua" in directory
/usr/local/lib/lua/5.1/luasql/.


> And there will be a way to force the load of the C module?

You can call package.loadlib (new name for loadlib) directly (or
you can call the C loader).

-- Roberto