I have a plist file which is being monitored for changes using FSEvents API.
_fileStream = FSEventStreamCreate(NULL,
&fsevents_apps_callback,
&context,
(__bridge CFArrayRef)[NSArray arrayWithObject:@"/"],
kFSEventStreamEventIdSinceNow,
(CFAbsoluteTime)0.2,
kFSEventStreamCreateFlagFileEvents);
// start the stream on the main event loop
FSEventStreamScheduleWithRunLoop(_fileStream,
CFRunLoopGetCurrent(),
kCFRunLoopDefaultMode);
FSEventStreamStart(_fileStream);
I am using sudo defaults to write to plist. Sudo defaults /Library/Application Support/myApp/file.plist
In my callBack function , the event path is turning out to be /Library/Application Support/myApp/file.plist.52738
I am concerned with it being detecting as file.plist.2332(some random number) and not file.plist
Any Inputs why this behaviour is seen ?
If we use PlistBuddy to write it , it all looks fine and event path is /Library/Application Support/myApp/file.plist.