this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

FSEvents: respect the absence of kFSEventStreamCreateFlagFileEvents

+26 -20
+26 -20
src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m
··· 222 222 -(void)_processSingleEvent:(struct inotify_event*)evt 223 223 { 224 224 FSEventStreamEventFlags flags = 0; 225 - 226 - if (evt->mask & IN_ISDIR) 227 - flags |= kFSEventStreamEventFlagItemIsDir; 228 - else 229 - flags |= kFSEventStreamEventFlagItemIsFile; // TODO: symlinks 230 - 231 - if (evt->mask & (IN_DELETE|IN_DELETE_SELF)) 232 - flags |= kFSEventStreamEventFlagItemRemoved; 233 - if (evt->mask & (IN_MOVE_SELF|IN_MOVED_FROM|IN_MOVED_TO)) 234 - flags |= kFSEventStreamEventFlagItemRenamed; 235 - if (evt->mask & (IN_MODIFY)) 236 - flags |= kFSEventStreamEventFlagItemModified; 237 - if (evt->mask & (IN_CREATE)) 238 - flags |= kFSEventStreamEventFlagItemCreated; 239 - if (evt->mask & IN_ATTRIB) 240 - flags |= kFSEventStreamEventFlagItemChangeOwner | kFSEventStreamEventFlagItemXattrMod; 225 + NSString* fullPath; 241 226 242 227 NSString* watchPath = [_wdMap objectForKey: [NSNumber numberWithInt: evt->wd]]; 243 228 if (!watchPath) 244 229 return; 245 230 246 - NSString* fullPath; 247 - 248 - if (evt->len == 0) 231 + if (!(_flags & kFSEventStreamCreateFlagFileEvents)) 232 + { 249 233 fullPath = watchPath; 234 + } 250 235 else 251 - fullPath = [NSString stringWithFormat: @"%s/%s", [watchPath UTF8String], evt->name]; 236 + { 237 + if (evt->mask & IN_ISDIR) 238 + flags |= kFSEventStreamEventFlagItemIsDir; 239 + else 240 + flags |= kFSEventStreamEventFlagItemIsFile; // TODO: symlinks 241 + 242 + if (evt->mask & (IN_DELETE|IN_DELETE_SELF)) 243 + flags |= kFSEventStreamEventFlagItemRemoved; 244 + if (evt->mask & (IN_MOVE_SELF|IN_MOVED_FROM|IN_MOVED_TO)) 245 + flags |= kFSEventStreamEventFlagItemRenamed; 246 + if (evt->mask & (IN_MODIFY)) 247 + flags |= kFSEventStreamEventFlagItemModified; 248 + if (evt->mask & (IN_CREATE)) 249 + flags |= kFSEventStreamEventFlagItemCreated; 250 + if (evt->mask & IN_ATTRIB) 251 + flags |= kFSEventStreamEventFlagItemChangeOwner | kFSEventStreamEventFlagItemXattrMod; 252 + 253 + if (evt->len == 0) 254 + fullPath = watchPath; 255 + else 256 + fullPath = [NSString stringWithFormat: @"%s/%s", [watchPath UTF8String], evt->name]; 257 + } 252 258 253 259 [_pathArray addObject: fullPath]; 254 260 const int newCount = [_pathArray count];