On Mon, 10 Oct 2011 15:42:26 -0400, simendsjo <simend...@gmail.com> wrote:
On 10.10.2011 21:38, bearophile wrote:
%u:
D>echo hello | wordcount2.exe< wordcount2.d
0 hello
std.stdio.StdioException@std\stdio.d(2156): Bad file descriptor
This is a bug in the C runtime that D uses, where pipes are not used
correctly. I'm working on getting Walter to fix it as it's needed for the
new std.process as well.
Try:
wordcount2.exe< wordcount2.d
Bye,
bearophile
Shouldn't the original way work too?
Yes, but the main difference is, bearophile's method simply opens a file,
which FILE * obviously supports no problem. Your method creates a process
with a pipe as the input.
-Steve