[Mono-list] Opening /dev/null using FileStream

Alan McGovern alan.mcgovern at gmail.com
Fri May 7 11:00:10 EDT 2010


Could you not just use Stream.Null?

Alan.

On Fri, May 7, 2010 at 3:47 PM, muhr <muhr at bluewin.ch> wrote:
>
> Hello all
>
> I'm trying to open "/dev/null" with a FileStream object, like this:
>
>    new FileStream("/dev/null", FileMode.Create, FileAccess.Write);
>
> but I keep getting IOExceptions because of a file sharing violation. The
> exact text is "Sharing violation on path /dev/null". I've tried several
> combinations of FileMode, FileAccess and FileShare flags in the constructor
> of FileStream, but all give the same error.
>
> Is it not possible to open /dev/null with a FileStream for writing or am I
> just using the wrong combination of flags?
>
> Btw. I am trying this under 64bit Linux using Mono 2.6.3 in case it's
> important.
>
> Best regards,
> Markus
>
> --
> View this message in context: http://mono.1490590.n4.nabble.com/Opening-dev-null-using-FileStream-tp2134314p2134314.html
> Sent from the Mono - General mailing list archive at Nabble.com.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>


More information about the Mono-list mailing list