Re: [solved, really!] Re: Human readable file type?
Re: [solved, really!] Re: Human readable file type?
- Subject: Re: [solved, really!] Re: Human readable file type?
- From: Finlay Dobbie <email@hidden>
- Date: Sun, 7 Jul 2002 16:43:08 +0100
On Sunday, July 7, 2002, at 04:29 PM, Allan Odgaard wrote:
- (NSString *)humanReadableFiletype:(NSString *)path
{
NSString *res;
FSRef fileRef;
FSPathMakeRef([path fileSystemRepresentation], &fileRef, NULL);
LSCopyKindStringForRef(&fileRef, (CFStringRef *)&res);
return [res autorelease];
}
To avoid CoreServices you could do:
- (NSString *)humanReadableFiletype:(NSString *)path
{
NSString *res;
LSCopyItemInfoForURL( (CFURLRef)[NSURL fileURLWithPath:path],
(CFStringRef *)&res );
return [res autorelease];
}
-- Finlay
_______________________________________________
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.