On Aug 24, 2012, at 8:59 PM, koko <k...@highrolls.net> wrote: > Excellent … much easier than
Well, in Carbon's defense, you're making things a lot harder than they have to be: > if(m_FSRef) free((void*)m_FSRef); > m_FSRef = malloc(sizeof(FSRef)); FSRefs don't have to be allocated on the heap. They're just structs. (Ditto with the FSCatalogInfo you use later.) > memset(m_FSRef,0x00,sizeof(FSRef)); There's no need to zero one out before initializing it. > const UInt8 *cpath = (const UInt8 *)[path > cStringUsingEncoding:NSUTF8StringEncoding]; -UTF8String is shorter. So you can reduce all the quoted stuff to one line: OSStatus osStatus = FSPathMakeRef((const UInt8 *)[path UTF8String], &m_FSRef, false); assuming you declare m_FSRef as an FSRef, not FSRef*. —Jens _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com