GetExecutable() private static method

private static GetExecutable ( PlatformAdaptationLayer pal, string command, string &executable, string &arguments ) : void
pal Microsoft.Scripting.PlatformAdaptationLayer
command string
executable string
arguments string
return void
示例#1
0
        internal static Process /*!*/ CreateProcess(RubyContext /*!*/ context, MutableString /*!*/ command,
                                                    bool redirectInput, bool redirectOutput, bool redirectErrorOutput)
        {
            string fileName, arguments;

            RubyProcess.GetExecutable(context.DomainManager.Platform, command.ToString(), out fileName, out arguments);
            Utils.Log(String.Format("Starting: '{0}' with args: '{1}'", fileName, arguments), "PROCESS");

            var p = new Process();

            p.StartInfo.FileName               = fileName;
            p.StartInfo.Arguments              = arguments;
            p.StartInfo.UseShellExecute        = false;
            p.StartInfo.RedirectStandardInput  = redirectInput;
            p.StartInfo.RedirectStandardOutput = redirectOutput;
            p.StartInfo.RedirectStandardError  = redirectErrorOutput;
            try {
                p.Start();
            } catch (Exception e) {
                throw RubyExceptions.CreateENOENT(fileName, e);
            }

            context.ChildProcessExitStatus = new RubyProcess.Status(p);
            return(p);
        }