Adapt for running from escript (fix).
This commit is contained in:
@@ -792,6 +792,7 @@ value_to_sql(X) -> sqlite3_lib:value_to_sql(X).
|
|||||||
-spec init([any()]) -> {'ok', #state{}} | {'stop', string()}.
|
-spec init([any()]) -> {'ok', #state{}} | {'stop', string()}.
|
||||||
init(Options) ->
|
init(Options) ->
|
||||||
PrivDir = get_priv_dir(),
|
PrivDir = get_priv_dir(),
|
||||||
|
io:format("PrivDir = ~p~n", [PrivDir]),
|
||||||
case erl_ddll:load(PrivDir, atom_to_list(?DRIVER_NAME)) of
|
case erl_ddll:load(PrivDir, atom_to_list(?DRIVER_NAME)) of
|
||||||
ok ->
|
ok ->
|
||||||
do_init(Options);
|
do_init(Options);
|
||||||
@@ -1075,6 +1076,8 @@ get_priv_dir() ->
|
|||||||
case is_escript() of
|
case is_escript() of
|
||||||
{true,Escript} ->
|
{true,Escript} ->
|
||||||
io:format("Escript = ~p~n", [Escript]),
|
io:format("Escript = ~p~n", [Escript]),
|
||||||
|
Which = code:which(sqlite3),
|
||||||
|
io:format("Which = ~p~n", [Which]),
|
||||||
{Pref,Suf} = lists:split(erlang:length(Escript), Which),
|
{Pref,Suf} = lists:split(erlang:length(Escript), Which),
|
||||||
io:format("Pref = ~p~n", [Pref]),
|
io:format("Pref = ~p~n", [Pref]),
|
||||||
io:format("Suf = ~p~n", [Suf]),
|
io:format("Suf = ~p~n", [Suf]),
|
||||||
|
|||||||
Reference in New Issue
Block a user