Copying contents of gzip file in character buffer

L

lokaresa

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.
 
L

liveshell

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...
 
S

santosh

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.
 
D

David Thompson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top