Copying contents of gzip file in character buffer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lokaresa@gmail.com

    Copying contents of gzip file in character buffer

    Dear,
    I have one .gz(gzip) file. I want to coping all contents
    of .gz file into character buffer.
    I tried, but at end of buffer i am getting '0xcd' extra one byte in
    buffer.Please tell, how I wrote C language program that will give the
    extract content of file in buffer.
  • liveshell

    #2
    Re: Copying contents of gzip file in character buffer

    On Mar 13, 11:09 am, lokar...@gmail. com wrote:
    Dear,
             I  have one .gz(gzip) file. I want to coping all contents
    of .gz file into  character buffer.
    I tried, but at end of buffer i am getting  '0xcd' extra one byte in
    buffer.Please tell, how I wrote C language program that will give the
    extract content of file in buffer.
    Can you please specify which function are you using to open and read
    gzip file??? Try to open and read using C lowelevel file handling
    functions...

    Comment

    • santosh

      #3
      Re: Copying contents of gzip file in character buffer

      lokaresa@gmail. com wrote:
      Dear,
      I have one .gz(gzip) file. I want to coping all contents
      of .gz file into character buffer.
      I tried, but at end of buffer i am getting '0xcd' extra one byte in
      buffer.Please tell, how I wrote C language program that will give the
      extract content of file in buffer.
      Please post the code for your attempt.

      Comment

      • David Thompson

        #4
        Re: Copying contents of gzip file in character buffer

        On Wed, 12 Mar 2008 23:09:53 -0700 (PDT), lokaresa@gmail. com wrote:
        Dear,
        I have one .gz(gzip) file. I want to coping all contents
        of .gz file into character buffer.
        I tried, but at end of buffer i am getting '0xcd' extra one byte in
        buffer.Please tell, how I wrote C language program that will give the
        extract content of file in buffer.
        Are you by any chance working on (MS) Windows, in debug mode?
        And (if so) how did you determine the length of the data you read?

        The Windows debug runtime fills malloc'ed space with 0xCD
        <caveatas a feature, this isn't required by the standard </>
        so if you read actually N bytes into a buffer but try to use N+1,
        you'll get an 'extra' byte of 0xCD.

        - formerly david.thompson1 || achar(64) || worldnet.att.ne t

        Comment

        Working...