public function addWatch($path, $cb, $flags = null)
{
$path = realpath($path);
if (!isset($this->files[$path])) {
$this->files[$path] = [];
if ($this->inotify) {
$this->descriptors[inotify_add_watch($this->inotify, $path, $flags ?: IN_MODIFY)] = $path;
}
}
$this->files[$path][] = $cb;
Timer::setTimeout('fileWatcher');
return true;
}