Reading stdin in Windows 7

2010-08-17 Thread Stanislav Blinov
Hello, I'm receiving strange results with reading stdin on Windows 7. Consider this code: module test; import std.stdio; void main(string[] args) { foreach (int i, string line; lines(stdin)) { write(line); } } On Linux, if I do 'cat test.d | ./test'

Reading stdin in Windows 7

2010-08-31 Thread Joel Christensen
>> Stanislav Blinov writes: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm receiving strange results with reading stdin on Windows 7. Consider this code: module test; import std.stdio; void main(string[] args) { foreach (int i, st

Re: Reading stdin in Windows 7

2010-08-17 Thread Stanislav Blinov
17.08.2010 14:41, Stanislav Blinov wrote: write(line); [snip] writef(line); [snip] Sorry, both should be 'write'. --

Re: Reading stdin in Windows 7

2010-08-18 Thread Jesse Phillips
Stanislav Blinov Wrote: > Hello, > > I'm receiving strange results with reading stdin on Windows 7. Consider > this code: > > module test; > > import std.stdio; > > void main(string[] args) > { > foreach (int i, string line; lines(stdin)) > { > write(line)

Re: Reading stdin in Windows 7

2010-08-19 Thread Stanislav Blinov
18.08.2010 17:54, Jesse Phillips wrote: In my experience Windows hasn't gotten piping right. And it has been known to have bugs, this might be related: http://stackoverflow.com/questions/466801/python-piping-on-windows-why-does-this-not-work Thanks, I'll take a look at that. --

Re: Reading stdin in Windows 7

2010-08-31 Thread Andrej Mitrovic
I get the same thing on XP. If you swap the two like so: type.exe | type.d Then it works but it will wait on exit. This works nicely: type.exe < type.d Joel Christensen Wrote: > >> > Stanislav Blinov writes: > Content-Type: text/plain; charset=UTF-8; format=flowed > Content-Transfer-Encodin

Re: Reading stdin in Windows 7

2010-08-31 Thread Andrej Mitrovic
Oooops, I meant: std.stdio.StdioException: Bad file descriptor type test.d | test.exe works, but waits on exit: test.exe | type test.d works fine: test.exe < test.d Andrej Mitrovic Wrote: > I get the same thing on XP. > > If you swap the two like so: > type.exe | type.d > > Then it works but

Re: Reading stdin in Windows 7

2010-09-02 Thread Joel Christensen
On 01-Sep-10 12:54 PM, Andrej Mitrovic wrote: Oooops, I meant: std.stdio.StdioException: Bad file descriptor type test.d | test.exe works, but waits on exit: test.exe | type test.d works fine: test.exe< test.d I think I get the same as you. Have to put Ctrl+C (or some thing) to get out, for

Re: Reading stdin in Windows 7

2010-11-14 Thread Adam Wall
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