Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]




On 21 May '08, at 9:22 PM, Lynn Barton wrote:

I am getting the date OK,
but not the type code, which should be “TEXT” for text files and might be
“WBBN” for a Microsoft Word document.

Most files don't have HFS type or creator codes anymore, because Cocoa apps don't usually set them. (Word probably does, because it's been around forever.) And downloaded files generally don't have them either unless they were encoded with StuffIt or MacBinary.


In general you're better off checking the filename extension. (I know. I used to be rabidly in favor of HFS types over extensions, but I gave up that fight years ago...)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode] (From: Lynn Barton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.