[Top][All Lists]

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

Re: Carbon port: setting the creator code (patch)

From: Steven Tamm
Subject: Re: Carbon port: setting the creator code (patch)
Date: Sat, 9 Jul 2005 09:08:16 -0700

Fine. You can do the same thing with osascript (although it's much more annoying).

The problem I have with it is that it will only set it to "EMAx", it can't set the file type, it will modify the creator code of already existing files, it doesn't test for UFS drives, etc.

Furthermore, Creator codes are being deprecated and replaced with file extension based mapping or Universal Type Identifiers. http://developer.apple.com/documentation/Carbon/Conceptual/ understanding_utis/

I have modified by system so that Emacs is the launch services default for text files with RCDefaultApp.

That doesn't mean we shouldn't add the feature to "set a creator code", but it should take in the code as a parameter (a four character string or a 32-bit number).
(mac-set-creator-type "EMAx")
(mac-set-file-type "TEXT")


On Jul 9, 2005, at 6:06 AM, David Reitter wrote:

On 9 Jul 2005, at 04:04, Steven Tamm wrote:

Sorry for the delay in reply, but it seems to me that using SetFile would be easier, and more flexible.

(defun mac-set-creator-code-for-file ()
(call-process shell-file-name nil nil t shell-command-switch (concat "/Developer/Tools/SetFile -c EMAx " buffer-file-name))
(add-hook 'after-save-hook 'mac-set-creator-code-for-file)

SetFile is only available if the Developer Tools are installed. That is not necessarily the case, and the other code doesn't introduce that dependency. The correct way to set file metadata is to go through Carbon, in this case. That's what the API is for...


Emacs-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]