[erlang-questions] Using erl_call

Anthony Kong anthony.hw.kong@REDACTED
Mon Feb 18 14:43:43 CET 2008

Hi, jb,

Yeah, I think Kenneth is right. He has to be right because he wrote
the some  of the erl_interface documentation, I just realised ;-)

So, first of all, sorry, I answered your question as if it is a normal
C programming question.

What you did (calling erl_call) can also be done using perl or similar
scripting languages, or even from a shell directly.  So, calling
erl_call using system() in c is really not what c-node is about.

So, in essence, Kenneth's idea is: A c-node should interface with an
erlang node using the said C API. You should take a look at the
erl_call.c file as an example.

(Correct me if I'm wrong, Ken)

I took a look at it and I found it fairly straight forward to understand.

It uses a set of ei_XXX API to get host name and then interact with an
erlang nodes
e.g. ei_gethostbyname and ei_connect_xinit

Lastly, if I understand correctly what you want in your last mail, I
think nothing stopped you from system("erl -s ...."), sleep for a
while, check the return code, and then initiate a sequence of ei_XXX
API to connect to this newly started erlang node. (So, only one
program to start both nodes) .

Hope this helps.

Cheers, Anthony

On Feb 18, 2008 11:32 PM, J Bhanot <j.bhanot@REDACTED> wrote:
> Hi Anthony,
> I want to start the Erlang node from my c node only....
> i.e. I execute only C program and both nodes are up and start
> communicating........
> I don't want to manually start erlang node or execute another script which
> does so....
> Thanks,
> jb

More information about the erlang-questions mailing list