objective c - FSEvents callback function event flag trouble -


i have fsevents stream, observe folder. when add files folder, callback function triggers that. but, thought can check specific event fseventstreameventflags constants, add file folder, or check file modified, can't. make history done:

void filesystemeventcallback(constfseventstreamref streamref, void *clientcallbackinfo, size_t numevents, void *eventpaths, const fseventstreameventflags eventflags[], const fseventstreameventid eventids[]) {   char **paths = eventpaths; int i; (i = 0; < numevents; i++) {      if (eventflags[i]==kfseventstreameventflaghistorydone) {         nslog(@"history done");     } } 

i check others fseventstreameventflags constants , there no constant trigger add file folder or modify file or delete. use construction now:

 void filesystemeventcallback(constfseventstreamref streamref, void *clientcallbackinfo, size_t numevents, void *eventpaths, const fseventstreameventflags eventflags[], const fseventstreameventid eventids[]) {   char **paths = eventpaths; int i; (i = 0; < numevents; i++) {      if (eventflags[i]==kfseventstreameventflaghistorydone) {         nslog(@"history done");     }     else{         nslog(@"some activity in folder");     }   } 

but when use construction, multiple callback (i.e. have multiple nslog message "some activity in folder"), when add file or else. why? how can make 1 callback?


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -