[erlang-questions] erl -s and erlang program distribution

Kenneth Lundin kenneth.lundin@REDACTED
Thu Feb 15 15:56:53 CET 2007


Hi,

It definately does not matter if you compile with erlc from a make file or with
the c function within the Erlang shell.
The same result will be produced, which is a .beam file placed somewhere in
the directory structure. Where it is placed is under your control when
compiling.
The default is in the current directory if not options are used.

WHAT DOES MATTER when trying to invoke a module via "erl -s <module>
IS that the module meaning the moduel.beam file can be found in the
Erlang code path.

The current directory is automatically in the code path so if you have
your module.beam in the current directory when invoking "erl -s
module" it will be loaded and the start function will be executed.

If you have your module.beam file somewhere else than in current directory for
example in "somedir" you have to add that directory to the code path for the
module to be found. You can do like this:
"erl -pa "FullOr_Relative_Path_toMydir" -s module"



/Regards Kenneth

On 2/15/07, Bengt Kleberg <bengt.kleberg@REDACTED> wrote:
> On 2007-02-14 20:36, Fernando Ipar wrote:
> ...deleted
> > Do I always have to compile modules from the shell?.
> > So far, I've been using a Makefile with erlc, but _perhaps_ this wasn't
> > working before and the
>
> fwiw: i have several erlang scripts. they are all compiled with erlc
> and work when started with erl -noshell -run <module> main [arg1 arg2 ...]
> if you have no arguments then -s and start/0 would make more sens than
> -run and main/1
>
>
> bengt
> --
> Those were the days...
>    EPO guidelines 1978: "If the contribution to the known art resides
>    solely in a computer program then the subject matter is not
>    patentable in whatever manner it may be presented in the claims."
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list