[erlang-questions] escript and ctrl+c

Vivek Ayer <>
Mon Apr 2 20:08:58 CEST 2012


Hi Dmitry,

So you're saying ctrl+c just throws some error code and I have to
write a halt function that handles that? Basically, I just want do
something similar to:

try:

except Exception:

that you'd see in python.

Thanks for the quick reply!
Vivek

On Mon, Apr 2, 2012 at 10:32 AM, Dmitry Kolesnikov <> wrote:
> Hello,
>
> erlang:halt(ErrorCode) make the trick for you.
>
> - Dmitry
>
> On Apr 2, 2012, at 8:23 PM, Vivek Ayer wrote:
>
>> Hi List,
>>
>> I've been using escripts to prototype erlang code. It's really great
>> and you can have something functional (no pun intended) very quick,
>> similar to prototyping in python.
>>
>> Anyways, escript serves all my needs except for shutdown signals. I
>> can't quite figure out how make an exit action like 'Ctrl+C' trigger
>> something like an 'exit' or 'stop' routine in my scripts. How would I
>> go about accomplishing this? Help appreciated.
>>
>> Thanks,
>> Vivek
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list