I have erlang application: *.app file and some *.erl files. I compile all of them. In terminal i start erl and there application:start(my_application)., all ok, but if i closed terminal application close too. How can i run application without terminal depending?
Thank you.
You likely want to use the
-noshelloption toerl. The syntax isSo in your case, this might be
This should allow you (for example if you are on Unix/Linux) to start your application as a background process and leave it running.
One useful variation is to also call the
stop/0function of theinitmodule so that the Erlang environment will stop when it has finished running your function. This comes in handy if you want to run a simple one-use function and pipe the output to some other process.So, for example, to pipe to
moreyou could doFinally, you might also be able to use the
escriptcommand to run your Erlang code as scripts rather than compiled code if it makes sense for your situation.Hope that helps.