Copying contents of gzip file in character buffer

  • Follow


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.
0
Reply lokaresa (5) 3/13/2008 6:09:53 AM

On Mar 13, 11:09=A0am, lokar...@gmail.com wrote:
> Dear,
> =A0 =A0 =A0 =A0 =A0I =A0have one .gz(gzip) file. I want to coping all cont=
ents
> of .gz file into =A0character buffer.
> I tried, but at end of buffer i am getting =A0'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...
0
Reply LiveShell (2) 3/13/2008 6:17:29 AM


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.

0
Reply santosh.k83 (3969) 3/13/2008 9:08:27 AM

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 
<caveat> as 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.net
0
Reply dave.thompson2 (767) 3/24/2008 2:14:26 AM

3 Replies
40 Views

(page loaded in 0.103 seconds)


Reply: