Re: Type/Creator codes
Re: Type/Creator codes
- Subject: Re: Type/Creator codes
- From: Richard Kiss <email@hidden>
- Date: Sun, 13 May 2001 14:11:26 -0700
on 5/13/2001 09:53:03 +1000, Jamie Curmi <email@hidden> wrote:
>
I can't seem to find any cocoa API for setting Type/Creator codes on
>
files you create. Does anyone know of any?
>
>
If not, a few questions:
>
>
1) Is Apple working on some?
>
2) I'm totally new to programming on the mac, so I have no idea how to
>
do this is in carbon. Could someone share how to do this, and maybe I
>
could write a cocoa wrapper for it? Assuming Apple aren't going to
>
release one soon?
This is a little off topic.
There does not seem to be any Cocoa API, and Carbon-based sample code has
been posted. I have some Darwin-based sample code that makes kernel calls to
change HFS metadata. It uses setattrlist directly, which is neither
well-documented nor particularly easy to use, but it could make a basis for
Objective-C wrappers that do not depend upon Carbon.
It also forms the basis for a tiny command-line tool that changes HFS
metadata (like /Developer/Tools/SetFile, which probably uses Carbon and
won't run on Darwin). I intend to release this someday, and hopefully
contribute it to Darwin.
-- Richard