• 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: NSFileManager: no way to check a file meets a set of file types??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileManager: no way to check a file meets a set of file types??


  • Subject: Re: NSFileManager: no way to check a file meets a set of file types??
  • From: Brian Smith <email@hidden>
  • Date: Thu, 28 Jun 2007 15:33:50 -0600


On Jun 28, 2007, at 2:56 PM, Stephane Sudre wrote:

When you need to filter out some file types in a NSOpenPanel, you can use the various fileTypes message of NSImage, QTMovie


So it seems strange to me that there is not a message in NSFileManager to check that a file at a filePath matches one of the fileTypes.


ex:

- (BOOL) fileMatchesTypes:(NSArray *) fileTypes;

No I don't think it has this but you can get a NSDictionary of the file attributes at a file path with fileAttributesAtPath:traverseLink: and use the NSFileManager's fileType category addition to it to get the file type, which you can then compare to your file types.

Am I missing something or is it a job for Bug Reporter (Enhancement Request)?



Might be worth it but in the mean time you write your own category to NSFileManager. I would use method signiture more like - (BOOL) fileAtPath:(NSString *)path matchesTypes:(NSArray *)fileTypes.


Brian
_______________________________________________

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


  • Follow-Ups:
    • Re: NSFileManager: no way to check a file meets a set of file types??
      • From: Stephane Sudre <email@hidden>
References: 
 >NSFileManager: no way to check a file meets a set of file types?? (From: Stephane Sudre <email@hidden>)

  • Prev by Date: NSFileManager: no way to check a file meets a set of file types??
  • Next by Date: Re: NSFileManager: no way to check a file meets a set of file types??
  • Previous by thread: NSFileManager: no way to check a file meets a set of file types??
  • Next by thread: Re: NSFileManager: no way to check a file meets a set of file types??
  • Index(es):
    • Date
    • Thread