[erlang-bugs] io:get_chars no longer respecting Control-D (eof) in Erlang 18.1

Tony Wallace tony@REDACTED
Fri Feb 19 04:26:17 CET 2016


My apologies.  Not sure why I had problems (yet) but it is not
an erlang bug.


Tony


-------- Forwarded Message --------
Subject: 	io:get_chars no longer respecting Control-D (eof) in Erlang 18.1
Date: 	Thu, 18 Feb 2016 22:43:36 +1300
From: 	Tony Wallace <tony@REDACTED>
To: 	erlang-bugs@REDACTED



The task is to produce an escript that reads standard input.  The code
that used to work was:


read_stdin() ->
    lists:flatten(read_stdin(io:get_chars(standard_io,"",8192))).
read_stdin(eof) ->
    [];
read_stdin(Data) ->
    [Data|read_stdin(io:get_chars(standard_io,"",8192))].


Now this code causes the program to hang.  If I try the following
command from the erlang prompt:

2> io:get_chars("",10).


and then try to end the input with control-D the command does not
return.  It could be a problem with
the shell intercepting the control-D or io:get_chars could be broken.

Tony Wallace




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20160219/3f0660a1/attachment.htm>


More information about the erlang-bugs mailing list