Take the following C# file, the simplest possible repro of my problem:
using System;
using System.IO;
public static class Test
{
public static void Main(string[] args)
{
string line;
while ((line = Console.In.ReadLine()) != null)
{
Console.Out.WriteLine(line);
}
}
}
When I build this under mono and run it on the console, everything works fine except that I can't send EOF. Typing CTRL-D just puts a weird character on the command line. I think that I'm checking for EOF the wrong way, but Console.In
is a TextReader
, which doesn't have the EndOfFile
property. How can I fix this?