[erlang-questions] escript cutting output
Fri Nov 18 13:50:21 CET 2011
On Friday, November 18, Tim Watson wrote:
> Have you tried this:
> S = self(),
> spawn_link(fun() -> io:format(Fmt, Data), S ! finished end),
> finished ->
> _Other -.
> This is a different situation to the one Ulf was describing in that thread
> I think.
You've posted a "solution" which doesn't even compile.
Nor have you even attempted to explain how this could possibly make a
difference. Fixing it up and applying it to Samuel's problem, like this:
%% Example: http://xkcd.com/386/
S = self(),
io:format("~p~p~n", [lists:duplicate(100000, $a), b]),
S ! finished
produces exactly the same behaviour as Samuel reported, i.e. it emits
a string which does not end in 'b'.
More information about the erlang-questions