gzip & Mac File Types

Rob Cozens rcozens at pon.net
Sat Sep 14 01:05:01 EDT 2002

Hi All,

As I add file compression & decompression to SDB Utilities, I have 
encountered an issue regarding Mac OS file types...as in how to 
determine the file type for the decompressed file?

I printed the GZIP v4.3 spec referenced in the Rev Dictionary; but 
(a) it's no help, and (b) it seems to me that I would have to get 
inside the decompress function to get to that level of info 
anyway...assuming it's even stored in the .gz.  The other option is 
to store file type in my own header information, but that would make 
the archive incompatible with standard .gzs

And before I deal with that issue, there is the question of 
determining the file type of a file selected for compression in an 
answer file dialog.  The fileType property is used to set the file 
type; so how does one determine the file type of a selected file?

A small tertiary issue: what is the standard Mac file type for gzip files?

I can get around much of this by writing a handler specific to my 
needs; but I would prefer to write something more general that could 
handle gzips created by other file compressors & vice versa.

If someone can show me how to address the file type issues, I'll 
write a generalized handler.  If not, I'll take the easy way out and 
write something specific to the .txts and .revs to be downloaded from 
the Library ftp site.

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)

More information about the Use-livecode mailing list