[erlang-questions] compile several modules from shell

Zoltan Lajos Kis kiszl@REDACTED
Tue Dec 1 11:54:45 CET 2009

Roberto Ostinelli wrote:
> dear all,
> as many of us are, i often use multiple nodes in my erlang
> applications. during development, all nodes reside on the same
> machine.
> fact is, when i compile a module on one of the nodes, the other nodes
> are erraticly updated with the freshly compiled module, even if it is
> not running [probably a cache of the loaded modules, i guess]. what i
> experience is that some nodes get updated, some others not, in a way i
> cannot figure a common pattern.
> therefore, the only thing i have figured out to do is to compile the
> module on the shell of all the running nodes, issuing the
> c(module_to_compile) command [which forces the refresh of the loaded
> modules].
> however, when i have to compile many modules, i find myself compiling
> all of them manually, repeatedly: c(module_1), c(module_2), .... on
> every node. this is annoying.
> my questions are:
> 1. is there another way to force the refresh [if this is the issue] so
> that, when i use a bash script to compile all modules all the nodes on
> the machine use the freshly compiled code?
> 2. otherwise, is ther a way to issue a shell compile on multiple
> modules [such as c(*) or such]?
> thank you,
> r.
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
How about something like this?

[case code:is_sticky(M) of true -> sticky; _ -> c(M), nl(M) end || {M, 
_} <- code:all_loaded()].


More information about the erlang-questions mailing list