Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52555

Re: Pair of filenos read/write each other?

Date 2013-08-15 08:56 -0700
From Jack Bates <tdhfwh@nottheoilrig.com>
Subject Re: Pair of filenos read/write each other?
References <mailman.552.1376435986.1251.python-list@python.org> <op.w1r5rqzha8ncjz@gnudebeest>
Newsgroups comp.lang.python
Message-ID <mailman.600.1376582179.1251.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Aug 14, 2013 at 01:17:40AM +0100, Rhodri James wrote:
> On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates <tdhfwh@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.

Thanks, I am writing a fixture to test an app. The app normally uses the Python
wrapper for the GnuTLS library to handshake with a service that I want to
mock up in my fixture. The app passes a file descriptor number to
gnutls_transport_set_ptr()

When I test the app, the app and fixture run in the same process. I want a file
descriptor number I can foist on the app, and in the fixture access what is
read/written to it by the GnuTLS wrapper.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-13 16:10 -0700
  Re: Pair of filenos read/write each other? "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-08-14 01:17 +0100
    Re: Pair of filenos read/write each other? Chris Angelico <rosuav@gmail.com> - 2013-08-14 01:55 +0100
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 08:56 -0700
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 08:59 -0700
  Re: Pair of filenos read/write each other? Roy Smith <roy@panix.com> - 2013-08-13 21:37 -0400
  Re: Pair of filenos read/write each other? Nobody <nobody@nowhere.com> - 2013-08-14 08:21 +0100
    Re: Pair of filenos read/write each other? Antoine Pitrou <solipsis@pitrou.net> - 2013-08-14 08:34 +0000
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 09:19 -0700
    Re: Pair of filenos read/write each other? Antoine Pitrou <solipsis@pitrou.net> - 2013-08-15 18:24 +0000

csiph-web