Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'advice.': 0.09; 'cc:addr :python-list': 0.11; 'suggest': 0.14; 'descriptor': 0.16; 'merged': 0.16; 'write,': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'trying': 0.19; 'split': 0.19; 'written': 0.21; 'aug': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'questions:': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'help!': 0.26; 'order.': 0.26; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'received:24': 0.27; 'chris': 0.29; 'am,': 0.29; 'bigger': 0.30; '+0100,': 0.31; 'context,': 0.31; 'subject:other': 0.31; 'anyone': 0.31; 'file': 0.32; 'no,': 0.35; 'there': 0.35; '14,': 0.36; 'vice': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'thank': 0.38; 'depends': 0.38; 'writes': 0.38; 'anything': 0.39; 'read': 0.60; 'numbers': 0.61; "you're": 0.61; 'content-disposition:inline': 0.62; 'such': 0.63; 'more': 0.64; 'different': 0.65; 'to:addr:gmail.com': 0.65; '(message': 0.84; 'subject:read': 0.84; 'involved.': 0.91; 'subject:Pair': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nottheoilrig.com; s=mail; t=1376582368; bh=7ntd1zn3CBGjKKb/UP3swUQALA3FPko8EXGXylL2haE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=kDUPzwDvKOXo9XUAiRkQCrAsu+JhUAjhE6SfRfUy5VMpbwggT20bkfvznfPc63fdp 3IO5HpRkdy2Y4sHVY3YRYFhxbwQ5gujVZc3qepXM7VdNPIETwjRpLUDrkFZwlKxIfa UvuaEkalE/dHluZbemlAzcPM8ImYOBR2ho/ptgbQ= Date: Thu, 15 Aug 2013 08:59:29 -0700 From: Jack Bates To: Chris Angelico Subject: Re: Pair of filenos read/write each other? References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376582372 news.xs4all.nl 15931 [2001:888:2000:d::a6]:42213 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52556 On Wed, Aug 14, 2013 at 01:55:38AM +0100, Chris Angelico wrote: > On Wed, Aug 14, 2013 at 1:17 AM, Rhodri James > wrote: > > On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates > > 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? No, only one process is involved. > 2) Do you need to separate individual writes (message mode)? No, data can be split into smaller writes or merged into a bigger write, so long as it arrives in order. > ChrisA Thank you for your help!