bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popen binary mode patch


From: Eric Blake
Subject: Re: popen binary mode patch
Date: Mon, 05 Apr 2010 15:31:13 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 04/05/2010 02:56 PM, Bruce Korb wrote:
> And also the write flavors of popen:  popen(xx,O_BINARY?"wb":"w")
> 
> I have to say, though, the "I know what you want, but I won't
> do it because you didn't ask for "r" mode the way I want you to"
> error messages are the bain of one's programming existence.
> I think it the wrong choice.  :(

In cygwin 1.5, it made a difference.  But now that cygwin 1.7 is out,
pipes are binary only, so popen(xx,"r") and popen(xx,"rb") should be
strictly equivalent (and you have to use the non-standard setmode() to
get a text-mode pipe).  So, it _might_ be enough to just use
popen(xx,"r"), and get the right behavior after all, if you don't care
about portability to older cygwin.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]