索引节点
¥Inodes
在 Linux 和 macOS 系统上,fs.watch()
将路径解析为 inode 并监视 inode。如果监视路径被删除并重新创建,则会为其分配一个新的索引节点。watch 将触发删除事件,但会继续监视原始 inode。不会触发新索引节点的事件。这是预期的行为。
¥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 文件在文件的生命周期内保留相同的索引节点。在 AIX 上保存和关闭监视文件将产生两个通知(一个用于添加新内容,另一个用于截断)。
¥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).