[Mono-bugs] [Bug 76075][Nor] New - Cannot write to named pipe using
FileStream
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Sep 12 18:49:55 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by fcantelmi at bloomberg.net.
http://bugzilla.ximian.com/show_bug.cgi?id=76075
--- shadow/76075 2005-09-12 18:49:55.000000000 -0400
+++ shadow/76075.tmp.28909 2005-09-12 18:49:55.000000000 -0400
@@ -0,0 +1,66 @@
+Bug#: 76075
+Product: Mono: Runtime
+Version: 1.1
+OS: Debian Woody
+OS Details: Debian Sid
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: io-layer
+AssignedTo: dick at ximian.com
+ReportedBy: fcantelmi at bloomberg.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Cannot write to named pipe using FileStream
+
+Description of Problem:
+Cannot write to named pipe using FileStream.
+It looks like CanSeek is 'true' in System.IO.FileStream:FlushBuffer which
+leads to MonoIO.Seek throwing an exception. CanSeek wraps an istance
+variable which is set in the constructor based upon the return value of
+MonoIO.GetFileType.
+
+Steps to reproduce the problem:
+1. run "mkfifo my_fifo" on the Linux command line
+2. run cat my_fifo in a separate window
+3. edit NamedPipe.cs as
+using System;
+using System.IO;
+
+public class NamedPipe {
+ public static void Main(string[] args) {
+ try {
+ using(Stream s = new FileStream("my_fifo", System.IO.FileMode.Open)) {
+ TextWriter tw = new StreamWriter(s);
+ tw.WriteLine(DateTime.Now);
+ tw.Flush();
+ }
+ } catch (Exception ex){
+ Console.WriteLine(ex.StackTrace);
+ }
+ }
+}
+
+4. run "mcs NamedPipe.cs -main:NamedPipe"
+4. run "mono NamedPipe.exe"
+
+Actual Results:
+in <0x00085> System.IO.FileStream:FlushBuffer ()
+in (wrapper remoting-invoke-with-check) System.IO.FileStream:FlushBuffer ()
+in <0x0002b> System.IO.FileStream:Dispose (Boolean disposing)
+in <0x00010> System.IO.FileStream:Close ()
+in <0x0000b> System.IO.Stream:System.IDisposable.Dispose ()
+in <0x000b3> NamedPipe:Main (System.String[] args)
+
+Expected Results:
+I expect the string returned by DateTime.Now.ToString() to appear in the
+window where I am catting my_fifo
+
+How often does this happen?
+every time.
+
+Additional Information:
+thanks. please let me know how I can help investigate.
More information about the mono-bugs
mailing list