Determining EOF character

Daniel Klein danielk at aracnet.com
Sun Feb 18 17:08:10 EST 2001


On Sun, 18 Feb 2001 11:35:41 -0800, Erik Max Francis <max at alcyone.com> wrote:

>Daniel Klein wrote:
>> On Windows the child process needs to send a ^Z in response to
>> readlines() and
>> on UNIX it needs to send ^D. I don't know what this is on MAC.
>
>This isn't the way you should signal end of file.  You should signal it
>the client closing his end of the pipe.  In fact, what you suggest above
>may work on Windows, but it won't work on UNIX -- under UNIX, an end of
>file isn't indicated with a sentinel character in the stream, but rather
>with an out-of-bounds indicator (the underlying file structure has an
>end-of-file flag).  As I recall, Windows/DOS does much the same thing,
>but also treats a ^Z as an explicit end-of-file indicator.

I'm not sure what you mean by "You should signal it the client closing his end
of the pipe". This is an interactive session with the client and server in
constant communication. If I close the pipe, I can do no further processing.

How do I specify this 'out-of-bounds' indicator?

Dan



More information about the Python-list mailing list