mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-05 16:42:58 +00:00
Merge https://github.com/rvanzon/cappuccino into rvanzon-xcc
This commit is contained in:
commit
8c205faf2d
1 file changed
+19
-2
@@ -125,8 +125,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
return;
|
||||
|
||||
[self stopEventStream];
|
||||
|
||||
NSArray *pathsToWatch = [NSArray arrayWithObject:aPath];
|
||||
|
||||
NSMutableArray *pathsToWatch = [NSMutableArray arrayWithObject:aPath];
|
||||
void *appPointer = (void *)self;
|
||||
FSEventStreamContext context = {0, appPointer, NULL, NULL, NULL};
|
||||
CFTimeInterval latency = 2.0;
|
||||
@@ -143,6 +143,23 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
flags = kFSEventStreamCreateFlagUseCFTypes;
|
||||
}
|
||||
|
||||
// add symlinked directories
|
||||
NSArray *fileList = [fm contentsOfDirectoryAtPath:aPath error:nil];
|
||||
|
||||
for (NSString *node in fileList)
|
||||
{
|
||||
NSDictionary *attributes = [fm attributesOfItemAtPath:aPath error:nil];
|
||||
if ([[attributes objectForKey:@"NSFileType"] isEqualTo:NSFileTypeDirectory])
|
||||
{
|
||||
NSString *subDirectoryPath = [aPath stringByAppendingPathComponent:node];
|
||||
NSString *symlinkDestination = [fm destinationOfSymbolicLinkAtPath:subDirectoryPath error:nil];
|
||||
if (symlinkDestination)
|
||||
{
|
||||
[pathsToWatch addObject:subDirectoryPath];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stream = FSEventStreamCreate(NULL, &fsevents_callback, &context, (CFArrayRef) pathsToWatch,
|
||||
[lastEventId unsignedLongLongValue], latency, flags);
|
||||
|
||||
|
||||
Reference in new issue
Block a user