Re: NSOpenPanel & NSFileTypeForHFSTypeCode
Re: NSOpenPanel & NSFileTypeForHFSTypeCode
- Subject: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 11 Oct 2007 09:06:48 -0300
At 21:48 -0700 10/10/2007, email@hidden wrote:
>From: Chris Heimark <email@hidden>
>References: <email@hidden>
> <email@hidden>
> <email@hidden>
> <email@hidden>
> <email@hidden>
> <email@hidden>
>In-Reply-To: <email@hidden>
>Date: Wed, 10 Oct 2007 21:27:21 -0400
>Message-ID: <email@hidden>
>...
>// delegate function for NSOpenPanel
>- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename{
> if ([filename hasPrefix:@"/Volumes/"])
> return TRUE;
> else
> return FALSE;}
Note that it's perfectly possible to find mounted volumes outside of /Volumes.
One possible test is (using Carbon's File Manager) to get an FSRef for that path, then request the nodeID via FSGetCatalogInfo.
A volume's root directory will always have the nodeID == 2.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
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