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?
Which version of mono? I fixed that problem in r129444 in 2009-03-16… Your program runs as expected when I press Ctrl-D.
Update: Nice. I found out that 2.4.x.y versions don’t have the fix :-(. It will be in the upcoming 2.6 version… Sorry about that.
Update 2: mono-2-4 was branched on 2009-03-13. I missed it by 3 days!