Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Dynamically create path to NIF relative to module.

Assumes the lib is in the priv directory.
  • Loading branch information...
commit 5d8600faa567c065cf3b161ce98dfe71602bf07b 1 parent 859492c
@msantos authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/procket.erl
View
9 src/procket.erl
@@ -37,11 +37,18 @@
-on_load(on_load/0).
+
init() ->
on_load().
on_load() ->
- ok = erlang:load_nif("priv/procket", []).
+ Lib = filename:join([
+ filename:dirname(code:which(?MODULE)),
+ "..",
+ "priv",
+ ?MODULE
+ ]),
+ erlang:load_nif(Lib, []).
open(_) ->
erlang:error(not_implemented).
Please sign in to comment.
Something went wrong with that request. Please try again.