Re: [IronPython] fepy socket seek

2006-11-17 Thread Dino Viehland
position information? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Baus Sent: Thursday, November 16, 2006 12:36 AM To: Discussion of IronPython Subject: Re: [IronPython] fepy socket seek > Solution: Check if stream is seekable in PythonBin

Re: [IronPython] fepy socket seek

2006-11-16 Thread Christopher Baus
> Solution: Check if stream is seekable in PythonBinaryReader too. If > it's not seekable, it doesn't make much sense to set Position "to > synchronise" anyway. I've been tracing this bug tonight, and I feel concerned about it. The CRLF reader allows seeking even when the underlying stream doe

Re: [IronPython] fepy socket seek

2006-11-15 Thread Christopher Baus
> When you write to file, > 1. writer is checked for null. If it is, stream is not writable. Raise > exception. > 2. string is passed to the writer. > 3. The writer does appropriate newline translation and write it. > 4. The number of bytes written, after newline translation, is returned. > 5. read

Re: [IronPython] fepy socket seek

2006-11-15 Thread Sanghyeon Seo
2006/11/16, Christopher Baus <[EMAIL PROTECTED]>: > Good question. The seek must be in the binary write. I'm not calling it > directly. Again, the error only occurs when the binary flag is set. Any > write on a socket file with the binary flag set causes a seek error. Let's see what's going on

Re: [IronPython] fepy socket seek

2006-11-15 Thread Christopher Baus
> where's the seek ? > > the second argument to makefile is the requested buffer size. > Good question. The seek must be in the binary write. I'm not calling it directly. Again, the error only occurs when the binary flag is set. Any write on a socket file with the binary flag set causes a seek

Re: [IronPython] fepy socket seek

2006-11-14 Thread Fredrik Lundh
Christopher Baus wrote: > I found a problem with the fepy socket module. Seek operations aren't > supported, but they are supported in CPython (not totally sure how they do > that). > > Here's an example. > > import socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.connect(("baus

Re: [IronPython] fepy socket seek

2006-11-14 Thread Christopher Baus
> Here's an example. > > import socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.connect(("baus.net", 80)) > file = s.makefile('wb', 1500) > file.write("anything\r\n") The problem only occurs with the binary mode set, which is very strange. The following: file = s.makefile('w',

[IronPython] fepy socket seek

2006-11-14 Thread Christopher Baus
I found a problem with the fepy socket module. Seek operations aren't supported, but they are supported in CPython (not totally sure how they do that). Here's an example. import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("baus.net", 80)) file = s.makefile('wb', 1500)