[erlang-bugs] R15B01 : lib:progname/0 of erlc is erl...

Ulf Wiger <>
Thu Jun 7 09:56:14 CEST 2012


In fact, this can be made a bit more predictable with the
help of the environment variable ERLC_EMULATOR.
(documented on the erlc man page).

"ERLC_EMULATOR
The command for starting the emulator. Default is erl in the same directory as the erlc program itself, or if it doesn't exist, erl in any of the directories given in the PATH environment variable."

BR,
Ulf W

On 7 Jun 2012, at 09:04, Bengt Kleberg wrote:

> 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
>> 
>> http://erlang.org/mailman/listinfo/erlang-bugs
> 
> 
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com





More information about the erlang-bugs mailing list