[R] pipe and binary i/o

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon Aug 5 23:01:47 CEST 2002


pipe predates readBin, and no one has seen a reason to do this before you.

It's an adequate fix.

On Mon, 5 Aug 2002, Huntsinger, Reid wrote:

> I often want to use "pipe" with "readBin" to read (binary) data from the
> standard output of a Perl or C program. For that I need "pipe" to work with
> the "open='rb'" option. It never worked for me, and after a look at the
> connections.c file, I see that in "pipe_open" the mode gets passed directly
> to "popen" (I'm using Linux on an Intel machine). Popen doesn't know "rb"
> and fails. I modified the pipe function in connection.c to pass only the
> first character of the mode. This seems to work (fingers crossed). Then I
> noticed gzfile has the same problem, but bzfile doesn't, and uses the same
> solution as I did for pipe. Can I assume that this is a correct fix? Or were
> there reasons that pipe and gzfile wouldn't allow "rb"?
>
> Thanks,
>
> Reid Huntsinger

[irrelevant message deleted]

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list