索引节点


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

AIX 文件在文件的生命周期中保留相同的索引节点。 在 AIX 上保存和关闭监视的文件将导致两个通知(一个用于添加新内容,一个用于截断)。

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).