CreateProcess() static private method

static private CreateProcess ( RubyContext context, MutableString command, MutableString args ) : Process
context RubyContext
command MutableString
args MutableString
return System.Diagnostics.Process
示例#1
0
文件: IoOps.cs 项目: ltwlf/IronSP
        public static RubyIO /*!*/ OpenPipe(
            RubyContext /*!*/ context,
            MutableString /*!*/ command,
            IOMode mode)
        {
            bool redirectStandardInput  = mode.CanWrite();
            bool redirectStandardOutput = mode.CanRead();

            Process process = RubyProcess.CreateProcess(context, command, redirectStandardInput, redirectStandardOutput, false);

            StreamReader reader = null;
            StreamWriter writer = null;

            if (redirectStandardOutput)
            {
                reader = process.StandardOutput;
            }

            if (redirectStandardInput)
            {
                writer = process.StandardInput;
            }

            return(new RubyIO(context, reader, writer, mode));
        }