[erlang-questions] escript cutting output

Samuel samuelrivas@REDACTED
Thu Nov 17 09:49:58 CET 2011


I sent this a couple of weeks agou, but apparently my emails are not
reaching the list (at least I got no responses and they are not listed
in http://erlang.org/pipermail/erlang-questions). I'm trying from a
different account now:
I'm having trouble with an escript that outputs quite a lot
ofinformation and I'm not sure where I have to look for a
cleansolution. I traced my problem down to next simple escript:
---#!/usr/bin/env escript
main(_) ->   io:format("~p~p~n", [lists:duplicate(100000, $a), b]).---
If I run this in a linux terminal emulator the output gets
cutsomewhere in the middle of the a characters, the b never shows:
$ io_test"aaaaaaaaaaa.....aaa$
I found several ways of getting it to work, but none convincing:
 * Putting cat in the middle:
$ io_test | cat"aaaaa...aaaaaaaa"b$
 * Putting a timer:sleep(1000) after the io:format works also
I tried calling init:stop() before exiting in the hope of it
waitingfor the io system to exit clenaly, but that didn't make
Any ideas about what I'm doing wrong?

More information about the erlang-questions mailing list