Re: Determining a file's "kind"
Re: Determining a file's "kind"
- Subject: Re: Determining a file's "kind"
- From: Mark de Jong <email@hidden>
- Date: Sat, 15 Jun 2002 00:29:15 -0700
Steven,
If you:
#import <Foundation/NSHFSFileTypes.h>
you get the following functions:
=====
/* Given an HFS file type code, this function returns a string that
encodes
** the file type as described above. The string will have been
autoreleased.
*/
NSString *NSFileTypeForHFSTypeCode(OSType hfsFileTypeCode);
/* Given a string of the sort encoded by NSFileTypeForHFSTypeCode(),
** this function returns the corresponding HFS file type code. It
returns
** zero otherwise.
*/
OSType NSHFSTypeCodeFromFileType(NSString *fileTypeString);
/* Given the full absolute path of a file, this function returns a
string that
** encodes the file's HFS file type as described above, or nil if
the operation
** was not successful. The string will have been autoreleased.
*/
NSString *NSHFSTypeOfFile(NSString *fullFilePath);
=====
. Hopefully, they'll do what you want.
-- Mark
On Friday, June 14, 2002, at 05:46 PM, Steven Frank wrote:
Given a path to a file, how do I get the string that the Finder
displays in the "Kind" field of the "Show Info" window?
Seems like this should be an NSFileManager thing
(fileAttributesAtPath?), but it's not mentioned in the docs.
Thanks,
Steven
_______________________________________________
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.
_______________________________________________
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.