Can I find out which file was modified using fsevent?

I get the directory path from fsevent, like "/ User / Data /" But I really want to /User/Data/change.txt "I read the programming guide, he said

typedef void ( *FSEventStreamCallback )(
    ConstFSEventStreamRef streamRef,
    void *clientCallBackInfo,
    size_t numEvents,
    void *eventPaths,
    const FSEventStreamEventFlags eventFlags[],
    const FSEventStreamEventId eventIds[]);  

eventPaths An array of paths to the directories in which events (events) occurred.

Is there any way to find out which file is modified? thank you !!!! I stuck on it for so long.

+3
source share
3 answers

An alternative is kqueue. See Appendix A in the “File System Event Programming Guide”.

+5
source

fsevents . root. /dev/fsevents FSEvents. , .

+3

10.7+ kFSEventStreamCreateFlagFileEvents FSEventStreamCreate . . documentation.

+1

Source: https://habr.com/ru/post/1750208/


All Articles