Note that there are some explanatory texts on larger screens.

plurals
  1. POFSEvents callback function event flag trouble
    primarykey
    data
    text
    <p>I have a <code>FSEvents</code> stream, I observe a folder. When I add some files to that folder, callback function triggers that. But, I thought that I can check a specific event with <code>FSEventStreamEventFlags</code> constants, like add file to my folder, or check that the file was modified, but I can't. I could make this only with history done:</p> <pre><code>void fileSystemEventCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { char **paths = eventPaths; int i; for (i = 0; i &lt; numEvents; i++) { if (eventFlags[i]==kFSEventStreamEventFlagHistoryDone) { NSLog(@"history Done"); } } </code></pre> <p>I check all others <code>FSEventStreamEventFlags</code> constants and there is no constant that will trigger add a file to my folder or modify file or delete. I use this construction for now:</p> <pre><code> void fileSystemEventCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { char **paths = eventPaths; int i; for (i = 0; i &lt; numEvents; i++) { if (eventFlags[i]==kFSEventStreamEventFlagHistoryDone) { NSLog(@"history Done"); } else{ NSLog(@"some activity in a folder"); } } </code></pre> <p>But when I use this construction, I get a multiple callback (i.e. I have a multiple NSLog message "some activity in a folder"), when I add file or something else. Why? How can I make to get only one callback?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload