Pair of filenos read/write each other?

Chris Angelico rosuav at gmail.com
Tue Aug 13 20:55:38 EDT 2013


On Wed, Aug 14, 2013 at 1:17 AM, Rhodri James
<rhodri at wildebst.demon.co.uk> wrote:
> On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates <tdhfwh at nottheoilrig.com>
> wrote:
>
>> Can anyone suggest a way to get a pair of file descriptor numbers such
>> that data written to one can be read from the other and vice versa?
>>
>> Is there anything like os.pipe() where you can read/write both ends?
>
>
> Sockets?  It depends a bit on what you're trying to do, exactly.  If you
> give us a bit more context, we might be able to give you better advice.

Specific questions:

1) Do you need different processes to do the reading/writing?
2) Do you need to separate individual writes (message mode)?

ChrisA



More information about the Python-list mailing list