www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8528] New: std.stream.File believes /dev/stdin to be seekable


           Summary: std.stream.File believes /dev/stdin to be seekable
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: lomereiter gmail.com

--- Comment #0 from Artem Tarasov <lomereiter gmail.com> 2012-08-09 09:24:38
PDT ---
(I'm aware that std.stream will be replaced but anyway...)

If I access stdin like this, seekable flag is set:

    new std.stream.File("/dev/stdin"); // seekable = true

A workaround is to use std.stdio.File:

    auto g0 = std.stdio.File("/dev/stdin");
    auto g = new std.stream.File(g0.fileno, FileMode.In); // seekable = false

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 09 2012