索引节点


在 Linux 和 macOS 系统上,fs.watch() 解析索引节点的路径并监视索引节点。 如果监视路径被删除并重新创建,则会为其分配一个新的索引节点。 监视将触发删除事件,但将继续监视原始索引节点。 不会发出新索引节点的事件。 这是预期的行为。

On Linux and macOS systems, fs.watch() resolves the path to an inode and watches the inode. If the watched path is deleted and recreated, it is assigned a new inode. The watch will emit an event for the delete but will continue watching the original inode. Events for the new inode will not be emitted. This is expected behavior.

AIX files retain the same inode for the lifetime of a file. Saving and closing a watched file on AIX will result in two notifications (one for adding new content, and one for truncation).