title: Writing to FIFO FILE, Linux & Mono(C#)
body: <p>I want to do what I wrote in the title. But I just simply can't get my head around it. I also googled everythng. I want to write strings to file of special type FIFO, created by mkfifo (I think). If there are any other suggestions how to do this, you are welcome. </p>
  
  <pre><code>static class PWM
  {
  
      static string fifoName = "/dev/pi-blaster";
  
      static FileStream file;
      static StreamWriter write;
  
      static PWM()
      {
          file = new FileInfo(fifoName).OpenWrite();
  
          write = new StreamWriter(file, Encoding.ASCII);
      }
  
      //FIRST METHOD
      public static void Set(int channel, float value)
      {
          string s = channel + "=" + value;
  
          Console.WriteLine(s);
  
          write.Write(s);
  
          // SECOND METHOD
         // RunProgram(s);
      }
  
      //SECOND METHOD
      static void RunProgram(string s)
      {
          System.Diagnostics.Process proc = new System.Diagnostics.Process();
          proc.EnableRaisingEvents = true;
  
          proc.StartInfo.FileName = "bash";
          string x = "|echo " +s+" &gt; /dev/pi-blaster";
          Console.WriteLine(x);
  
          proc.StartInfo.Arguments = x;
          proc.StartInfo.UseShellExecute = false;
  
          proc.StartInfo.RedirectStandardInput = true;
  
          proc.Start();
         // proc.WaitForExit();
      }
  }
  </code></pre>