title: Using redirection in unity c#
body: <p>I'm trying to redirect the input from a file using &lt; , which sends data from the file (input.txt)and feeds it to the program, this is the command that I run in the terminal </p>
  
  <pre><code>    ./rubik3Sticker.ida2 corner.bin edge1.bin edge2.bin &lt; input.txt
  </code></pre>
  
  <p>my question is that how can I do the redirection thing in unity? here's my code that actually runs the process and accepts the parameters but when it comes to redirection, it fails :\ </p>
  
  <pre><code>     void Start(){
       try {
       myProcess = new Process();
       myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
       myProcess.StartInfo.CreateNoWindow = true;
       myProcess.StartInfo.UseShellExecute = false;
       myProcess.StartInfo.RedirectStandardOutput = true;
       myProcess.StartInfo.RedirectStandardInput = true;
       myProcess.StartInfo.FileName = "C:\\Users\\sam\\Desktop\\Test\\rubik3Sticker.ida2";
       myProcess.EnableRaisingEvents = true;
       myProcess.StartInfo.WorkingDirectory = "C:\\Users\\sam\\Desktop\\Test";
       myProcess.StartInfo.Arguments = "corner.bin edge1.bin edge2.bin";
       myProcess.OutputDataReceived += new DataReceivedEventHandler((sender, e) =&gt;
      {
          if (!String.IsNullOrEmpty(e.Data))
          {
              print(e.Data);
              print ("here");
          }
      });
      myProcess.Start();
      StreamWriter myStreamWriter = myProcess.StandardInput;
      String inputText = File.ReadAllText(inputFilePath);
      myStreamWriter.Write(inputText);
      myProcess.BeginOutputReadLine();
       } catch (Exception e){
           print(e);        
       }
       myProcess.WaitForExit();
  }
  </code></pre>
  
  <p>any kind of help is appreciated, thanks!</p>