ffi.load()
Opens a native shared library.
Signature
ffi.load(path)
Parameters
Nonempty string path without embedded NUL.
Returns
Library handle.
Behavior
Uses the platform dynamic loader. The library remains live through its bindings and associated pointers. Close explicitly when finished.
Errors
File missing, loader incompatibility or dependent library failure.
Example
Build the native C fixture and pass its shared library path after --.
use ffi
use os
lib = ffi.load(os.args[0])
try:
assert(type(lib) == library)
finally:
ffi.close(lib)