Reading stdin in Windows 7

Adam Wall agcwall at gmailc.om
Sun Nov 14 12:30:37 PST 2010


I experience the exact same problem on Windows 7 64-bit.

> import std.stdio;
>
> int main() {
>     char[] buf;
>     while (stdin.readln(buf))
>         write(buf);
>     return 0;
> }

If compiled as "test.exe", running the following command:

> echo "test line 1" | test

Produces the following result:

> std.stdio.StdioException: Bad file descriptor
> "test line 1"
>



More information about the Digitalmars-d-learn mailing list