473,410 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

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.
Mar 13 '08 #1
3 2207
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...
Mar 13 '08 #2
lo******@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.

Mar 13 '08 #3
On Wed, 12 Mar 2008 23:09:53 -0700 (PDT), lo******@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.net
Mar 24 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Thomas Lotze | last post by:
Hi, another question: What's the most efficient way of copying data between two file-like objects? f1.write(f2.read()) doesn't seem to me as efficient as it might be, as a string containing...
10
by: Xah Lee | last post by:
today i need to use Python to decompress gzip files. since i'm familiar with Python doc and have 10 years of computing experience with 4 years in unix admin and perl, i have quickly located the...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
1
by: chris.atlee | last post by:
I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much...
24
by: allpervasive | last post by:
hi all, this is reddy, a beginner to c lang,,here i have some problems in reading and modifying the contents of a file,, hope you can help to solve this problem. Here i attach the file to be...
0
by: mahdaeng | last post by:
I have a little Windows application written in C# with a SQLite back- end. I'm using the System.Data.SQLite provider. One of the features the application provides is a database back-up, which...
3
by: Sean Davis | last post by:
I have a set of numpy arrays which I would like to save to a gzip file. Here is an example without gzip: b=numpy.ones(1000000,dtype=numpy.uint8) a=numpy.zeros(1000000,dtype=numpy.uint8) fd =...
1
by: Nader | last post by:
Hello, I have a gzip file and I try to read from this file withe the next statements: gunziped_file = gzip.GzipFile('gzip-file') input_file = open(gunziped_file,'r') But I get the nezt...
1
by: Nader | last post by:
Hello, I have a gzip file and I try to read from this file withe the next statements: gunziped_file = gzip.GzipFile('gzip-file') input_file = open(gunziped_file,'r') But I get the nezt...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.