Re: NSFileManager: no way to check a file meets a set of file types??
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