I am writing a file watcher and stat for some reason cant get a hold of file information, why?
struct stat info;
int fd = open(path, O_EVTONLY);
if (fd <= 0){
exit(-1);
}
int result = fstat(fd, &info);
if (!result){
exit(-1); //This happens! Errno says "No such file or directory" but that cant be because open would've failed
}
Check
fstatman page, on success 0 is returned.