gzip & Mac File Types

Jeanne A. E. DeVoto jeanne at runrev.com
Sat Sep 14 02:29:01 CDT 2002


At 11:02 PM -0700 9/13/2002, Rob Cozens wrote:
>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.

It isn't. The file type and creator are meta information that is unique to
Mac OS filesystems; other filesystems don't have it and therefore gzip
doesn't store it (nor restore it). In general, on Mac OS systems this is
handled with the File Exchange control panel (nee "Easy Open" or "Macintosh
Easy Open") - it maps between extensions and types, and most of the
relevant apps seem to use it. I'm not sure what OS X does, but this whole
area is still a bit of a mess on OS X anyway.

>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?

I don't have a handler to hand at the moment, but the detailed files will
return the necessary info (you'll have to massage it to get the data for
the specific file, and to get the type and creator info). I probably ought
to put this in the Cookbook...

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list