<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
My apologies. Not sure why I had problems (yet) but it is not<br>
an erlang bug.<br>
<br>
<br>
Tony<br>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" cellpadding="0"
cellspacing="0" border="0">
<tbody>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Subject:
</th>
<td>io:get_chars no longer respecting Control-D (eof) in
Erlang 18.1</td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Date: </th>
<td>Thu, 18 Feb 2016 22:43:36 +1300</td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">From: </th>
<td>Tony Wallace <a class="moz-txt-link-rfc2396E" href="mailto:tony@tony.gen.nz"><tony@tony.gen.nz></a></td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>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
</pre>
<br>
</div>
<br>
</body>
</html>