• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [solved, really!] Re: Human readable file type?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: [solved, really!] Re: Human readable file type?
      • From: Allan Odgaard <email@hidden>
    • Re: [solved, really!] Re: Human readable file type?
      • From: Finlay Dobbie <email@hidden>
References: 
 >[solved, really!] Re: Human readable file type? (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: Preview in Internet Explorer
  • Next by Date: Setting a target in IB for NSImageView has no effect?
  • Previous by thread: [solved, really!] Re: Human readable file type?
  • Next by thread: Re: [solved, really!] Re: Human readable file type?
  • Index(es):
    • Date
    • Thread