[erlang-bugs] R15B01 : lib:progname/0 of erlc is erl...
Bengt Kleberg
bengt.kleberg@REDACTED
Thu Jun 7 09:04:08 CEST 2012
Greetings,
The lib module is marked deprecated. This makes me wonder if you are
willing to consider another less-than-production-quality solution?
In that case, have you considered looking at arguments to distinguish
erl vs erlc?
Ex: On my system init:get_arguments/0 return both {mode,["minimal"]} and
{boot,["start_clean"]} for erlc, but not erl.
bengt
On Tue, 2012-06-05 at 21:53 +0200, PAILLEAU Eric wrote:
> Hi,
> sorry to monopolize the list.
>
> I'm using ~/.erlang file in order to automatize some applications start
> in developpement.
>
> But my applications are starting when compiling with erlc .
> Well, erlc evaluates ~/.erlang at start like erl . OK...
>
> I first used some plain arguments on erl start to detect erl or erlc but
> I forget often to add it in my command line. I wanted to do something
> smarter.
>
> So I wrote in my ~/.erlang file :
> ------------------------------------
> case lib:progname() of
> 'erlc' -> ok ; % do nothing
> 'erl' -> % start my favorite apps
> ...
> end.
> ------------------------------------
>
> Applications are starting anyway when compiling.
>
> This can be seen by writing in ~/.erlang file :
> ------------------------------------
> io:fwrite("~p~n",[lib:progname()]).
> ------------------------------------
>
> erlc -Wall -I include -o ebin/ src/xxxxx.erl
> erl
>
> The progname of erlc is erl ...
>
> --------- Erlang doc -----------------------------------------
> lib:progname() -> atom()
>
> Returns the name of the script that started the current Erlang session.
> ---------------------------------------------------------------
>
> erlc is a binary, erl is a shell script that launch erlexec which is a
> binary too.
> So what exactly the meaning of the documentation ? Is it a bug in erlc ?
> Even if erlc is a wrapper of erl, I suppose it should have erlc as
> program name ...
>
> Regards.
>
>
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
More information about the erlang-bugs
mailing list