title: how to write to unix fifo in c#
body: <p>I am trying to write to linux fifo using both <code>File.WriteAllText(string)</code> as well as AppendAllText, this is what I get:</p>
  
  <p>The code is simply</p>
  
  <pre><code>void Foo()
  {
      File.AppendAllText("fifo", "blah");
  }
  </code></pre>
  
  <p>file is "fifo" it was created using</p>
  
  <pre><code>mkfifo fifo
  </code></pre>
  
  <p>blah is random string I am trying to write there. I am getting this exception:</p>
  
  <pre><code>Unhandled Exception: System.NotSupportedException: The stream does not support seeking
    at System.IO.FileStream.Seek (Int64 offset, SeekOrigin origin) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
    at System.IO.File.AppendAllText (System.String path, System.String contents) [0x00000] in &lt;filename unknown&gt;:0 
    at listener.User.InitialiseClient (System.Object data) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Threading.Thread.StartInternal () [0x00000] in &lt;filename unknown&gt;:0 
  [ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: The stream does not support seeking
    at System.IO.FileStream.Seek (Int64 offset, SeekOrigin origin) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
    at System.IO.File.AppendAllText (System.String path, System.String contents) [0x00000] in &lt;filename unknown&gt;:0 
    at listener.User.InitialiseClient (System.Object data) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Threading.Thread.StartInternal () [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>
  
  <p>the file was created using mkfifo, I can for example do <code>echo test &gt;&gt; file</code> but I would like to use c# function rather than calling external binary</p>