On OSX, I'm using this technique to detect new files dragged, dropped, and created in a folder path (or subpath).
However, the Apple Documentation doesn't include any information on how to compute the value of FSEventStreamEventFlags.
So, through trial and error, I'm having to make an array like so:
const unsigned short TOTAL_EVENTS = 9;
unsigned int anEvents[TOTAL_EVENTS];
anEvents[0] = 125184; // download
anEvents[1] = 105728; // another way to download
anEvents[2] = 116992; // another way to download
anEvents[3] = 128256; // same folder paste
anEvents[4] = 108544; // new file created
anEvents[5] = 110848; // another way new file created
anEvents[6] = 67584; // file dragged in
anEvents[7] = 127232; // file inside folder that was dragged in
anEvents[8] = 128768; // file replace on paste
Please tell me that there has to be a better way? I mean, surely those numbers are the result of some bitwise ANDs on some base number, and then I can do this more scientifically instead of storing some constants?