• 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: Determining general type of a file (image, text, sound, etc...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining general type of a file (image, text, sound, etc...)


  • Subject: Re: Determining general type of a file (image, text, sound, etc...)
  • From: "Owen Yamauchi" <email@hidden>
  • Date: Sat, 28 Jun 2008 15:23:15 -0700

On Sat, Jun 28, 2008 at 2:37 PM,  <email@hidden> wrote:
> Hi
>
> I'm writing a "KFile" class that encapsulates a bunch of file operations that are spread out over several Cocoa and Carbon classes and want to have a couple of testing methods such as "isImageFile", "isMusicFile", "isTextFile" etc. I'm trying to avoid hard coding HFS types and/or file extensions and have it perform these tests much like the Finder does in it's search window where you can specify file kind as "Images", "Music", "Text", "Movies" etc. Is there any any built in way, in either Cocoa or Carbon, to get a list of types that correspond to say "Images" or perform a test on a specific file that returns true for "Images"?

You could use the command-line utility "file" via an NSTask. Look at
its manpage for more info.

Owen
_______________________________________________

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:

This email sent to email@hidden

References: 
 >Determining general type of a file (image, text, sound, etc...) (From: email@hidden)

  • Prev by Date: Re: Building a Setup Assistant
  • Next by Date: Re: List of Indexed Accessor Names for NSMutableArray
  • Previous by thread: Re: Determining general type of a file (image, text, sound, etc...)
  • Next by thread: Methods that return autoreleased objects?
  • Index(es):
    • Date
    • Thread