how to capture io:format's output using ei?

Serge Aleynikov <>
Tue Oct 18 19:25:16 CEST 2005


Interesting...

Though in my case even if I use "~n" then nothing gets returned.  If I 
use "\n" then, 'ok' gets returned, however, a "Test string\n" gets 
printed in the shell window of the  node:

devlinuxpro2> ./erl_call -sname  -a 'io format ["Test 
string~n"]'
devlinuxpro2>

()9>
()9>

devlinuxpro2> ./erl_call -sname  -a 'io format ["Test 
string\n"]'
ok          <-- the result of a call got printed
devlinuxpro2>

()9> Test string\n     <-- this is printed in the shell
()9>

So, the original question still stands: could you tell how to redirect 
the output when using the ei's rpc call?

Thanks.

Serge

Ulf Wiger (AL/EAB) wrote:
> Serge Aleynikov wrote:
> 
>>When I run a distributed Erlang session below, the output 
>>gets captured 
>>correctly:
>>
>>~> erl -noshell -sname t -eval \
>>   'rpc:call(, io, format, ["Test string~n"])' -s init 
>>stop
>>Test string
>>~>
>>
>>However, using erl_call (written using ei) doesn't display 
> 
> [...]
> 
>>~> ./erl_call -sname  -a 'io format ["Test 
>>string~n"]' -r
>>~>
> 
> 
> 
> Interestingly, if you remove the "~n", it seems to work.
> 
> That is, all of these work on my R10B:
> 
> 
>>erl_call -v -sname  -a 'io format [user,"hello\n",[]]'
>>erl_call -v -sname  -a 'io format [user,hello,[]]'
>>erl_call -v -sname  -a 'io format [hello]'
>>erl_call -v -sname  -a 'io format ["hello"]'
> 
> 
> but as soon as there's a tilde in there, nothing happens.
> 
> /Uffe



More information about the erlang-questions mailing list