Re: Creator Code in Cocoa-Java App
Re: Creator Code in Cocoa-Java App
- Subject: Re: Creator Code in Cocoa-Java App
- From: Ali Ozer <email@hidden>
- Date: Wed, 31 Jul 2002 10:55:08 -0700
How can I set the creator code of a file in a Cocoa-Java app?
I tried using MRJFileUtils.setFileCreator(file, new MRJOSType("xxxx"))
but
that freezes the app.
Is there another way to set the creator code of a file in a Cocoa-Java
app?
In ObjC, NSFileManager does this; in Cocoa/Java, the functionality is
exposed in NSPathUtilities, as NSPathUtilities.setFileAttributes().
Unfortunately in 10.1 the possible keys to this are not explicitly
defined, but for creator use "NSFileHFSCreatorCode".
Something like:
NSMutableDictionary fileAttrs = new NSMutableDictionary();
fileAttrs.setObjectForKey(new Integer(0x41414141),
"NSFileHFSCreatorCode"); // Set creator to "AAAA"
NSPathUtilities.setFileAttributes(fileName, fileAttrs);
Ali
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.