NSWorkspace getInfoForFile:application:type:
NSWorkspace getInfoForFile:application:type:
- Subject: NSWorkspace getInfoForFile:application:type:
- From: "Jonathan D. Nolen" <email@hidden>
- Date: Wed, 8 Aug 2001 11:24:56 -0700
I've been having some trouble with NSWorkspace's
getInfoForFile:application:type: method. It's supposed to give you
two strings: one for the application that will open the file, and
another to tell you what type of file it is (Directory, Application,
Filesystem, etc).
In the source code below, the appName string comes back just fine,
but the fileType is always empty. Can anyone spot what I doing wrong?
- (BOOL) isItemADriveAtPath:(NSString *) thePath {
NSString *appName;
NSString *fileType;
[[NSWorkspace sharedWorkspace] getInfoForFile: thePath
application: &appName
type: &fileType ];
NSLog(@"appName = %@\n", appName);
NSLog(@"fileType = %@\n", fileType);
if( [ fileType isEqualToString:@"NSFilesystemFileType" ] ) {
return YES;
}
return NO;
}
I found a Usenet post from someone else who ran into the same
problem, but no one ever answered him.
(
http://groups.google.com/groups?q=NSWorkspace&hl=en&safe=off&rnum=3&selm=9e9duf$adu$email@hidden)
If this is a bug, can anyone suggest a workaround?
Any help is much appreciated.
Thanks,
Jonathan
--
Jonathan D. Nolen
mail: email@hidden