I'm using this fslogger.c to get File System Notifications in my Mac. But it works only in Leopard & SnowLeopard, not in Lion or Mountain Lion.
http://osxbook.com/software/fslogger/download/fslogger.c
when trying to clone the /dev/fsevents using ioctl it returns the error number 14(Bad Address). I have tried fixing it,i thought it could be some issues in ioctl function arguments. So i have tried modifying that, but no use at all. I couldn't get that fixed at all. Any idea how to make it work for Lion & Mountain Lion.