io:get_chars no longer respecting Control-D (eof) in Erlang 18.1

Tony Wallace <[email protected]> Thu, 18 Feb 2016 22:43:36 +1300
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <[email protected]>
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


_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs