Re: Working with creator codes in OS X
Re: Working with creator codes in OS X
- Subject: Re: Working with creator codes in OS X
- From: Axel Luttgens <email@hidden>
- Date: Mon, 03 Sep 2001 10:15:26 +0200
- Organization: ---
Thanks to Lloyd and Garbanzito to have made appear my imprecision.
Don't know how I managed to end with the lines of text about setting a file's
creator type...
Some preliminary notes before trying to explain what I intended to write:
- I'm considering the Finder's "get/set creator type of..." commands,
only (more generally, vanilla AS only)
- I'm reasoning on HFS volumes (I hadn't the opportunity to check if
AS acts upon the "dot underscore" files)
- I'm considering document files only.
File type and creator are stored in the volume's catalog. When an OSX app
(let's say TextEdit) creates a file, it does not necessarily use those
fields; in such a case, they are both initialized with 4 consecutive null
bytes upon file's creation (and this seems to be the 'missing value' returned
by AS).
When you set the creator type of such a file to a given value with AS, you
can't revert to the initial state: you just can write another 4-characters
string in place. Of course, same holds for files that you encounter with
already defined type and creator.
Technically, AS doen't allow to "remove" a creator type (this would need a
disk editor or some similar software). But if the intend is to "modify the
behavior of a document's icon upon double clicking", then the question is
somewhat broader and refers to OSX's mechanism of binding document files to
apps.
For example, under some circumstances, it could be sufficient just to change
(or remove) a file's extension.
Or, since type/creator (when defined) seem to have prevalence in OSX's
Finder, to put the signature of another application (or to use some reserved
creator code with a conventional meaning; Garbanzito seems to have pointed
such one).
Sorry for not having been careful enough.
Will try not to do it again
By the way: when associating a given document to a given application (in the
Finder's "Info for..." dialog), the information seems to be stored in... the
document's resource fork (OSX 10.0.4).
Is this true, or just a bad interpretation of mine?