digitalmars.D.learn - std.stream for stdin?
- dsimcha (7/7) Jul 11 2008 I've been trying to write some small Unix-style utilities that read data...
- Jarrett Billingsley (3/13) Jul 11 2008 import std.cstream, and use the din object :)
- dsimch (9/9) Jul 11 2008 How is this class supposed to be used? I wrote a simple test program, a...
- Jarrett Billingsley (4/16) Jul 11 2008 *shrug*
- dsimcha (1/1) Jul 11 2008 Never mind. The problem was I had another test.exe file at a higher lev...
- Jarrett Billingsley (3/5) Jul 11 2008 I hate those kinds of issues ;)
I've been trying to write some small Unix-style utilities that read data from either a file or stdin, process it and write the results to stdout. Is there a way to create an object of the Stream class from Phobos or one of its subclasses that treats stdin as an input stream? I'd like to avoid using the C standard file/stream I/O if possible, since it doesn't handle exceptions automatically and is just in general butt ugly compared to Phobos's implementation.
Jul 11 2008
"dsimcha" <dsimcha yahoo.com> wrote in message news:g57v7m$ss1$1 digitalmars.com...I've been trying to write some small Unix-style utilities that read data from either a file or stdin, process it and write the results to stdout. Is there a way to create an object of the Stream class from Phobos or one of its subclasses that treats stdin as an input stream? I'd like to avoid using the C standard file/stream I/O if possible, since it doesn't handle exceptions automatically and is just in general butt ugly compared to Phobos's implementation.import std.cstream, and use the din object :)
Jul 11 2008
How is this class supposed to be used? I wrote a simple test program, and it appears not to work the way other subclasses of Stream work. Here's the test program, which should just copy stdin to stdout, but seems to do absolutely nothing. void main () { foreach(char[] line; din) { writefln(line); } } Similar results occur when I use the readLine method.
Jul 11 2008
"dsimch" <dsimcha yahoo.com> wrote in message news:g58520$188d$1 digitalmars.com...How is this class supposed to be used? I wrote a simple test program, and it appears not to work the way other subclasses of Stream work. Here's the test program, which should just copy stdin to stdout, but seems to do absolutely nothing. void main () { foreach(char[] line; din) { writefln(line); } } Similar results occur when I use the readLine method.*shrug* I never had any problems using it.
Jul 11 2008
Never mind. The problem was I had another test.exe file at a higher level in my path.
Jul 11 2008
"dsimcha" <dsimcha yahoo.com> wrote in message news:g587ej$1cp1$1 digitalmars.com...Never mind. The problem was I had another test.exe file at a higher level in my path.I hate those kinds of issues ;)
Jul 11 2008