[erlang-questions] Escript archives and the load path

Siri Hansen <>
Wed Jul 11 10:35:05 CEST 2012

Hi Geoff!

There is no good way to do this really. Since rebar is an escript, the code
server can not read it as a general archive. The only option you have would
be to extract the archive part from it, write it to a file with .ez
extension and then add code path to it, e.g.

1> {ok,Stuff} = escript:extract("rebar",[]).
     {emu_args,"-noshell -noinput"},
2> Bin = proplists:get_value(archive,Stuff).
3> file:write_file("rebar.ez",Bin).
4> erl_prim_loader:list_dir("rebar.ez").
5> code:which(rebar).
6> code:add_path("rebar.ez").
7> code:which(rebar).


2012/7/10 Geoff Cant <>

> Hi all, after looking for a while, I couldn't figure out how to tell
> ERTS or the code server that /some/path/rebar was a valid place to load
> modules from.
> Is there a magic function / command-line flag I can use to get the
> contents of this escript archive into the code path?
> Cheers,
> --
> Geoff Cant
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120711/924cac2e/attachment.html>

More information about the erlang-questions mailing list