regading detection of stdin

Adam D. Ruppe destructionator at gmail.com
Sat Dec 7 12:33:56 PST 2013


Sounds like what you need is to see if stdin is a tty.

import core.sys.posix.unistd; // has isatty()

void main() {
         import std.stdio;
         writeln(isatty(0)); // 0 is stdin, so this will show 1 if 
keyboard or 0 if pope
}


More information about the Digitalmars-d-learn mailing list