Read/write linux named pipe (fifo) in Windows
<p>I would like to read and write a fifo created in Linux on an SMB share from an application in Windows using C#.  It seems that if I try to read from the pipe as if it were a normal file using <code>StreamReader</code> directly, it reaches the end of the stream without actually retrieving any data.  If I try using <code>NamedPipeClientStream</code>, it throws an <code>IOException</code> stating <code>A volume has been accessed for which a file system driver is required that has not yet been loaded.</code> This makes me think maybe this isn't doable. Are Named Pipes in Windows completely different from Linux? If so, can I treat this as a normal file?</p>

<p>Here is the code I used first:</p>

<pre><code>StreamReader file = new StreamReader(@"\\mvssuperos7\shared\lread");
String line;
while ((line = file.ReadLine()) != null)
{
    Console.WriteLine(line);
}

file.Close();
Console.WriteLine("Finished");
Console.ReadLine();
</code></pre>

<p>Pretty straightforward; from the Linux system, I have a text file with several lines of nonsense which I <code>cat</code> to the pipe.  This blocks, as I would expect it to, then I run the listed code, which prints "Finished" as if it reached the end of the stream.  This also unblocks <code>cat</code> on the Linux end, which I find precarious. </p>

<p>Here is the code I used with <code>NamedPipeClientStream</code>:</p>

<pre><code>StreamReader file = new StreamReader(@"\\mvssuperos7\shared\lread");
using (NamedPipeClientStream pipeClient =
new NamedPipeClientStream(@"mvssuperos7", "shared/lread", PipeDirection.In))
{

// to the pipe or wait until the pipe is available.
Console.Write("Attempting to connect to pipe...");
pipeClient.Connect();

Console.WriteLine("Connected to pipe.");
Console.WriteLine("There are currently {0} pipe server instances open.",
pipeClient.NumberOfServerInstances);
using (StreamReader sr = new StreamReader(pipeClient))
{
    // Display the read text to the console
    string temp;
    while ((temp = sr.ReadLine()) != null)
    {
        Console.WriteLine("Received from server: {0}", temp);
    }
}
</code></pre>

<p>This is what is throwing the Exception -- I'm assuming Windows Named Pipes are not what I'm looking for here, I'll have to read more about them. Any help is greatly appreciated.</p>