[Zlib-devel] zlib 1.2.4.1 beta

Mark Adler madler at alumni.caltech.edu
Sun Mar 28 23:35:29 EDT 2010


On Mar 28, 2010, at 5:53 PM, William A. Rowe Jr. wrote:
> Is there any reason for this at all?  We begin the entire exercise with
> fopen(file, "rb") / fopen(outfile, "wb") etc.  The underlying pseudo-fd
> handle should similarly be 'binary', no?

No.  The setmode() is for stdin or stdout.  The "b" in "rb" or "wb" for gzdopen() doesn't do anything, since the file descriptor is already open.  (Actually, it never does anything.)  Which leads naturally to the question:

On Mar 28, 2010, at 6:06 PM, William A. Rowe Jr. wrote:
> which does leave me with a question, what purpose does the char *mode arg
> serve, in the gzdopen() API?

It is for selecting read or write, providing compression options, and to append requests.

Mark





More information about the Zlib-devel mailing list