dir.read()
- 返回:<Promise> 返回一个 <fs.Dirent> | <null>
通过 readdir(3) 异步读取下一个目录条目,作为 <fs.Dirent>。
🌐 Asynchronously read the next directory entry via readdir(3) as an
<fs.Dirent>.
返回一个承诺,该承诺将在读取到 <fs.Dirent> 时被兑现,如果没有更多目录条目可读,则返回 null。
🌐 A promise is returned that will be fulfilled with an <fs.Dirent>, or null
if there are no more directory entries to read.
对于由本地文件系统处理的目录读取,这个函数返回的目录条目没有特定顺序,是操作系统底层目录机制提供的顺序。在遍历目录时添加或删除的条目可能不会包含在迭代结果中。
🌐 For directory reads handled by the native file system, directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms. Entries added or removed while iterating over the directory might not be included in the iteration results.