[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac Open file dialog

At 12:08 AM 4/22/94 +0000, Andrew Begel wrote:
>I have a slight problem. In the docs for (open-file-dialog) it says that 
>you can include a :mac-file-type parameter that will take a 4 char
>string (like "lisp", or "fasl") and restrict the directory entries in the open file dialog to those types. Has anyone ever used this feature? I've tried, 
>and instead of showing "lisp" files (say) it just shows no files except for

You've run afoul of the overloading of the word "type".  On the Mac, each file has two
internal (e.g. only visible using tools like ResEdit) four-character fields, a 'creator' and
a 'type'.  This information is what the finder uses to assign the right icons, launch 
applications when you click on files created by them, etc.  The functions MAC-FILE-TYPE
and MAC-FILE-CREATOR can access these internal types.  Lisp files in MCL have
a type of "TEXT" (and a creator of "CCL2"), whereas fasl files have a type of "FASL"
(and also a creator of "CCL2").

This has absolutely nothing to do with the part of a file name after a period, e.g. ".lisp",
which is sometimes called a "type" by other operating systems. 

You only saw directories because there were presumably no files with the internal
type you specified.

>Can anyone tell me the syntax on how to use this command? The docs are wrong in the 
>MCL 2.0 manual.
>Andy Begel
>MIT Media Lab
>Epistemology and Learning Group