Having a hard time...FSIsAliasFile
Having a hard time...FSIsAliasFile
- Subject: Having a hard time...FSIsAliasFile
- From: Mark Manes <email@hidden>
- Date: Sat, 17 Feb 2007 19:03:10 -0800
Guys,
I have code that is pretty simple. It compiles and works with certain
Alias files but others it returns no error and those alias files are
said to not be an alias file--yet they are. The finder says they are.
I say they are--yet this function continues to lie to me.
What am I missing?
Here is the code:
+ (BOOL) isFileAnAlias:(NSString *) fileName
{
FSRef ref;
Boolean aliasFileFlag;
Boolean folderFlag;
OSStatus error = 0;
NSLog(@"filename = %@",fileName);
NSString *homeDir = NSHomeDirectory();
NSString *location = [homeDir stringByAppendingFormat:@"/Desktop/%
@",fileName];
NSLog(@"location = %@",location);
error = FSPathMakeRef((const UInt8 *)[location
fileSystemRepresentation], &ref, NULL);
if (!error)
{
error = FSIsAliasFile(&ref, &aliasFileFlag, &folderFlag);
NSLog(@"error = %d",error);
NSLog(@"aliasFileFlag = %d",aliasFileFlag);
}
return true;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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