public function watchPath($path)
    {
        if (!$this->inotify) {
            $this->paths[] = $path;
            $this->addModifiedTimes($path);

            return;
        }

        $mask = IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | IN_MOVE | IN_CREATE |
                IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF;

        $directoryIterator = new \RecursiveDirectoryIterator(realpath($path));
        $subPaths = new \RecursiveIteratorIterator($directoryIterator);

        // Iterate over instances of \SplFileObject
        foreach ($subpaths as $subPath) {
            if ($subPath->isDir()) {
                $watchDescriptor = inotify_add_watch($this->inotify,
                    $subPath->getRealPath(), $mask);
                $this->paths[$watchDescriptor] = $subPath->getRealPath();
            }
        }
    }