~tcurdt/sparkle/devel

84 by andym
Fixed the installation code to *really* not go through aliases; it didn't really work before.
1
//
2
//  NSFileManager+Aliases.m
3
//  Sparkle
4
//
5
//  Created by Andy Matuschak on 2/4/08.
6
//  Copyright 2008 Andy Matuschak. All rights reserved.
7
//
8
9
#import "NSFileManager+Aliases.h"
10
11
198 by Andy Matuschak
Added prefixes to category names which didn't have them in order to avoid workspace collisions.
12
@implementation NSFileManager (SUAliases)
84 by andym
Fixed the installation code to *really* not go through aliases; it didn't really work before.
13
14
- (BOOL)isAliasFolderAtPath:(NSString *)path
15
{
16
	FSRef fileRef;
17
	OSStatus err = noErr;
18
	Boolean aliasFileFlag, folderFlag;
19
	NSURL *fileURL = [NSURL fileURLWithPath:path];
20
	
21
	if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef))
22
		err = coreFoundationUnknownErr;
23
	
24
	if (noErr == err)
25
		err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag);
26
	
27
	if (noErr == err)
28
		return (BOOL)(aliasFileFlag && folderFlag);
29
	else
30
		return NO;	
31
}
32
33
@end