lua-users home
lua-l archive

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


Alexander Gladysh wrote:
> I've got two questions / feature requests for ffi.load():
> 
> 1. On failure, do not throw error, but return nil, error_message.

Use pcall.

> 2. Please provide a way to set the lookup path, similar to lua.cpath.
> I would like to load a custom built .so without installing it to the
> system, with an option to fall back to the system one if custom is not
> available.

The underlying OS functions do not expose their lookup paths. You
can easily build this functionality yourself on top of ffi.load().

--Mike