lua-users home
lua-l archive

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


On Mon, Jul 11, 2011 at 17:39, Mike Pall <mikelu-1107@mike.de> wrote:
> 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.

Yuck. Oh, well, I can always wrap that. Probably being like require()
here makes more sense indeed.

>> 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().

With a chain of pcall-s()... and with reinventing lookup logic (which
is exposed in 5.2 only, AFAIR)...

Alexander.