void inotifyFunc(char *path char *command){ monitor.fd = inotify_init(); if(fcntl(monitor.fd, F_SETFL, O_NONBLOCK)){ perror("inotify not initialized: "); exit(0); } // ENOENT is replaced with command monitor.wd = inotify_add_watch(monitor.fd, path, command); if(monitor.wd < 0){ perror("Sorry"); exit(1); } else{ printf("Location '%s' is being monitored\n\n", path); } }
In this code, I am trying to write `inotifyFunc(pathname, command)`. The pathname is declared in the function and the `command variable` should be for `ENOENT`. It means whenever I try to execute and make changes in the filesystem, I should just write the pathname and a command(IN_CREATE, IN_MODIFY, etc) using inotifyFunc() in the main function. But it is not working and giving me the error message warning: passing argument 3 of ‘inotify_add_watch’ makes integer from pointer without a cast
inotify_add_watch
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)