From: joe bloggs [mailto:[EMAIL PROTECTED] 
> Just to clarify, I am using the full gzip format when
> file compression takes place (when compression level >
> 0).  When the data is not compressed I do not include
> the header or trailing data.

OK, it sounds like your intent is to produce either compressed gzip
files, or plain uncompressed files.  If this is correct, then for the
latter case can't you just store the original bytes and call it an
uncompressed file?

Then the issue becomes simply how to discover which format is used for a
given file.  You could use the .gz extension on gzipped files, and no
such extension on a regular file name.  This would be nicely compatible
with the desktop gzip utility, since you did say this is for expansion
cards, which might get mounted on a desktop.  Then the likely formats of
files named (say) Readme.txt and Bible.txt.gz would be apparent to
someone browsing the card.

Or if you don't want to use a filename extension, you could look for the
gzip magic header value (see the RFC) at the front of the file content,
which would be safe as long as an uncompressed file can't possibly start
with those specific bytes.

> Are saying that even if the data is not compressed, I
> still need to include the header and trailing data if
> I am going to pass the data to the deflate function?

A zlib stream with no compression is definitely not simply a stream
consisting of the uncompressed bytes.  Just treat any zlib stream as a
black box.

-slj-


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to