Define inotify function