a.escript:
main(_)->
b:read_config().
b.escript:
-module(b).
%% function exported
read_config()->
%% read file
io:format("hh~n").
If I convert the b.escript
to b.erl
and compile it to b.beam
, it works.
But I don't want to compile manually.
Maybe I can insert c:c(b)
like this:
main()->
c:c(b),
b:read_config().
Can't auto load the b.escript
when useing like b.eam
?
Yes, it is possible using
compile:file/1
a.escript
b.erl
Call from Shell