On Sunday, 8 November 2015 at 21:57:55 UTC, Alex Parrill wrote:
Post what you're trying to do if you want an example.

$ cat test.d
import std.stdio;

//void foo(Stream in_stream, Stream out_stream) // I want something like this
void foo(File in_stream, File out_stream)
{
        in_stream.seek(3); // BUG

        string line;
        while ((line = in_stream.readln()) !is null)
                out_stream.write(line);
}

void main(string[] args)
{
        foo(stdin, stdout);
}
$ cat test.txt
Line 0
Line 1
Line 2
$ gdc -o test test.d
$ ./test <test.txt
e 0
Line 1
Line 2
$ cat test.txt | ./test
std.exception.ErrnoException@../../../src/libphobos/std/stdio.d(595): Could not 
seek in file `' (Illegal seek)
$

Reply via email to