Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6570705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:47:22+00:00 2026-05-25T14:47:22+00:00

I downloaded the source from the site and built it but when I run

  • 0

I downloaded the source from the site and built it but when I run the test, all of the zipped files have CR+LF line endings rather than just LF which makes the unzipped files different from the originals.

I’m looking at the source but it seems like they are already opening the file in binary mode:

gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
    if ( is_open())
        return (gzstreambuf*)0;
    mode = open_mode;
    // no append nor read/write mode
    if ((mode & std::ios::ate) || (mode & std::ios::app)
        || ((mode & std::ios::in) && (mode & std::ios::out)))
        return (gzstreambuf*)0;
    char  fmode[10];
    char* fmodeptr = fmode;
    if ( mode & std::ios::in)
        *fmodeptr++ = 'r';
    else if ( mode & std::ios::out)
        *fmodeptr++ = 'w';
    *fmodeptr++ = 'b';
    *fmodeptr = '\0';
    file = gzopen( name, fmode);
    if (file == 0)
        return (gzstreambuf*)0;
    opened = 1;
    return this;
}

I’d really like to use this bit of code because it looks very clean and it compiled effortlessly on mingw gcc. The only problem is this tricky business which I could let slide if I can figure out a solution for it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:47:22+00:00Added an answer on May 25, 2026 at 2:47 pm

    I’ve successfully implemented my workaround. Though gzstream looks nice I bit the bullet and just wrote some code that directly uses zlib. Turns out it wasn’t bad at all because zlib has helpers hidden away in there, and also plenty of helpful comments in zlib.h itself.

    ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); is simple enough.

    And of course, no more problems with spurious 0x0D carriage-return chars!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded open-source version of Qt from the site and have compiled it with
I just downloaded the SWT examples from the Eclipse site but I have a
Hi i'm trying to build Liferay from source, i've downloaded liferay-portal-src-5.2.3.zip but when i
Recently I downloaded Live555 server source code from their site. I tried to compile
I am trying to build sipdroid under eclipse,I have downloaded the source from the
I am looking the hyphenation aglorithm downloaded from the OpenOffice site, but I couldn't
I have ASP.Net MVC 2 and 3 installed. I've downloaded the complete source from
I'm looking for documentation on boost::threadpool. I downloaded the source and documentation zip files.
I downloaded the lasted stable ruby source code from the ruby website (1.9.2-p180) and
I have been trying to follow this example (download the source code from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.