Interactive mode always false

freethread ft pe.freethread at live.com
Mon Apr 20 15:31:35 UTC 2015


Actually I'm using mono for few simple commands, specifically I use CS-Script (Oleg Shilo www.csscript.net) a wrapper to run C# sources as scripts (compile at run-time). It works, but I'm facing a misbehaviour trying to execute with a process (System.Diagostics.Process) the command 'portsnap fetch' returns error 0x01 and the message:

portsnap fetch should not be run non-interactively.
Run portsnap cron instead.

Then I tested the System.Environment.UserInteractive property both using CS-Script and in an compiled executable, with mcs, the following source

using System;
namespace Prog
{
    class Prog
    {
        public static int Main ()
        {
            Console.WriteLine ("Environment.UserInteractive = " +
                               (Environment.UserInteractive ? "true" : "false"));
        }
    }
}

in both cases (run as script and run compiled) the output is 'false'. Is this a feature or a bug? Actually I cannot test it in Windows, but I guess it should return 'true' if running as compiled executable at least.

Thanks for your time.

 		 	   		  


More information about the freebsd-mono mailing list