[Mono-list] C#/Mono Serial port communication

Gonzalo Paniagua Javier reply.to.the.list.iam.suscribed@notexists.ximian.com
Wed, 24 Nov 2004 17:15:57 -0500


--=-gvtQH0yGiez2kqmq+Hk/
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Wed, 2004-11-24 at 22:22 +0100, Jon-Eirik Pettersen wrote:
> I don't think I have enough information to do it.
> 
> It says the stream is seek-able because it thinks it is a normal file it 
> is opening, but seeking do not seems to work on devices.

The bug is exactly that. The runtime should figure out whether the file
is seekable or not.

> But if I send the data  directly to the FileStream using the 
> Write-function it works, but I have problems reading the data from the 
> stream.

Try using the stream in the file attached.

-Gonzalo



--=-gvtQH0yGiez2kqmq+Hk/
Content-Disposition: attachment; filename=st.cs
Content-Type: text/x-csharp; name=st.cs; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

using System.IO;

class NoSeekStream : FileStream {
	public NoSeekStream (string name, FileMode mode, FileAccess access)
		: base (name, mode, access)
	{
	}

	public override bool CanSeek {
		get { return false; }
	}
}


--=-gvtQH0yGiez2kqmq+Hk/--