staticgbooleansetup_file_watcher(){if((inotify_fd = inotify_init ()) <0)gotofailed;if((inotify_wd =inotify_add_watch(inotify_fd, SESSION_BUS_ADDRESS_FILENAME, IN_MODIFY | IN_ATTRIB | IN_DELETE_SELF)) <0)gotofailed;if((inotify_channel = g_io_channel_unix_new (inotify_fd)) ==NULL...
functionwatchADir($path){$this->dirs[$path] = $path;$this->ifds[$path] = inotify_init();$this->wds[$path] =inotify_add_watch($this->ifds[$path], $path,self::DIR_MASK);$this->log("add dir {$path} ". print_r($this->dirs,1) . print_r($this->wds,1)); } 开发者ID:go...
Method/Function: InotifyAddWatch 导入包: import ("syscall") 每个示例代码都附有代码来源和完整的源代码,希望对您的程序开发有帮助。 示例1 func main() { fd, err := syscall.InotifyInit() if err != nil { log.Fatal(err) } defer syscall.Close(fd) wd, err := syscall.InotifyAddWatch(fd, ...
// watch adds a new watcher to the set of watched objects or modifies the existing// one. If called for the first time, this function initializes inotify filesystem// monitor and starts producer-consumers goroutines.func(i *inotify)watch(pathstring, e Event)(err error){ife&^(All|Event(...