Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.095 X-Spam-Evidence: '*H*': 0.81; '*S*': 0.00; 'advice.': 0.09; 'suggest': 0.14; 'descriptor': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'trying': 0.19; 'written': 0.21; 'aug': 0.22; 'separate': 0.22; 'questions:': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; '+0100,': 0.31; 'context,': 0.31; 'subject:other': 0.31; 'anyone': 0.31; 'file': 0.32; 'received:google.com': 0.35; 'there': 0.35; '14,': 0.36; 'vice': 0.36; 'subject:?': 0.36; 'depends': 0.38; 'writes': 0.38; 'to:addr :python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'read': 0.60; 'numbers': 0.61; "you're": 0.61; 'such': 0.63; 'more': 0.64; 'different': 0.65; '(message': 0.84; 'subject:read': 0.84; 'subject:Pair': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BpUeWHovWJRVOklfQL1DZB6lpNB8AXs/2EPe5zPx+d4=; b=QwvCHGYwBxW4+4V5lfl5rsgvXStJZ4Q6fLuX6sTeA1Yv1UbtCB0zs+CgkzbgskicJy Sgi0kowOw3Al7YWJZ3wsBsA13sCYpVIT8FGsZsY4H2nJ6PXDCpxrl1m2wi6XtMlmbZDN ojX++D1jvR4LZlSohu1o1j1tWGKhvpabv0cQ+kSN9WUJx1Wt8y0b+j9AA9RaoqvHSskh +Etf8Q8tCiF/Iwy7OCvQ++4Lnyee/H7yrRkdwg5aN6bA4REradeVSMlgbHaExRc3Gh/r bB4qQCf7kzEohkPu9DYf9Z0juiizdb0YlIgK82GlDZKzSGYCwXLbyFO19JI0QbX2B3Ku pKow== MIME-Version: 1.0 X-Received: by 10.220.110.202 with SMTP id o10mr6655763vcp.1.1376441739177; Tue, 13 Aug 2013 17:55:39 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Aug 2013 01:55:38 +0100 Subject: Re: Pair of filenos read/write each other? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376441747 news.xs4all.nl 15958 [2001:888:2000:d::a6]:39201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52485 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? 2) Do you need to separate individual writes (message mode)? ChrisA