Determining EOF character

Grant Edwards grante at visi.com
Tue Feb 20 13:07:12 EST 2001


In article <jwbnews-081BEF.21114119022001 at news.olympus.net>, John W. Baxter wrote:
>
>> So why does closing the pipe to signal EOF not work?  I've
>> written a great many programs based on that.  The writer closes
>> the pipe and terminates, and the reader gets EOF and continues
>> operation.  What am I missing here?
>
>He wants to signal the end of each chunk of data, leaving the pipe open 
>for the next chunk.  I think he needs to define and use an end-of-chunk 
>sentinal.

Often, the easiest thing to do is to pass information in ASCII
and use '\n' as the chunk delimiter.  That way all of the
normal library routines just "do the right thing".

If you don't want to use ASCII, you can use some sort of binary
protocol (e.g. STX/ETX framing).

-- 
Grant Edwards                   grante             Yow!  Look into my eyes and
                                  at               try to forget that you have
                               visi.com            a Macy's charge card!



More information about the Python-list mailing list