delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/24/11:36:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B0D265D.B4F896FF@reversion.ca>
Date: Thu, 24 May 2001 09:18:53 -0600
From: Craig Nelson <nelson AT reversion DOT ca>
X-Mailer: Mozilla 4.08 [en] (X11; I; SunOS 5.8 i86pc)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cygwin_attach_handle_to_fd()
References: <3B0C35D4 DOT 5B3849D0 AT reversion DOT ca> <20010523192540 DOT A15862 AT redhat DOT com>

Christopher Faylor wrote:

> 'name' is the name of the file or device.
> 'bin' is true if the file should be opened in binary mode, false for text mode.
> 'access' is a windows setting like 'GENERIC_READ' or 'GENERIC-WRITE'.

I dont understand why you would need to pass "name".  isnt the point of this function  to simply attach the "int fd" to an
already opened HANDLE?  In my case, HANDLE is merely a result of CreatePipe() so there is no device name.  is it safe to pass NULL?

> It sounds like you're reinventing "popen" to me.

Yes, it's very close.. the bad thing about popen is that you only get one pipe and it is not bidirectional.  I was using the usual fork(), exec() way
of life, but it seems to give me loads of grief.  I've switched to using CreateProcess() and the grief goes away (except for this little problem
I'm having here).  I'll try some new things here and post my findings..

>
> Probably the best thing you could do is inspect the source code.  That's
> what I just did.

looking through there now.. but still unclear on "name"..  Do you know the impact of using it with an already open handle? ie: can I just set
"name" to NULL?

Thanks again for any input.

Craig Nelson, Cameo Systems Inc.


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019