The comments are misleading; the "not binary" is actually "not a pipe".  openmode will (should) contain the "b" required by Windows in the file case, courtesy of the code I excerpted earlier.  But the "b" is passed in as a constant to gbfopen() in tpo.cc, so that code shouldn't *have* to add the "b".

On Tue Apr 22 2014 at 12:17:55 PM, SRE <steve-babel@climber.org> wrote:
At 09:47 AM 4/22/2014, Robert Lipe wrote:
>The search space is gbfile.* and zlib.

in gzapi_open:
  if (self->is_pipe) {
    FILE* fd;
    if (self->mode == 'r') {
      fd = stdin;
    } else {
      fd = stdout;
    }
    SET_BINARY_MODE(fd);
    self->handle.gz = gzdopen(fileno(fd), openmode);
  } else {
    /** not binary! **/
    self->handle.gz = gzopen(self->name, openmode);
  }

Binary mode is only used if it's a pipe? Without tracking down what
that means, could it be that uncompressing shows as a pipe and all
you need to do is add another SET_BINARY_MODE to the else clause??
That seems too easy...

There are no debug outputs anywhere in this area, so perhaps another
good step would be to allow one of the higher levels of debug to
document choices being made while opening and (de)compressing files.

Steve