Skip to content

Commit 1fefd7f

Browse files
addaleaxtargos
authored andcommitted
doc: fs dir modifications may not be reflected by dir.read
PR-URL: #29893 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 216e200 commit 1fefd7f

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

doc/api/fs.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ Asynchronously read the next directory entry via readdir(3) as an
362362
After the read is completed, a `Promise` is returned that will be resolved with
363363
an [`fs.Dirent`][], or `null` if there are no more directory entries to read.
364364

365-
_Directory entries returned by this function are in no particular order as
366-
provided by the operating system's underlying directory mechanisms._
365+
Directory entries returned by this function are in no particular order as
366+
provided by the operating system's underlying directory mechanisms.
367+
Entries added or removed while iterating over the directory may or may not be
368+
included in the iteration results.
367369

368370
### dir.read(callback)
369371
<!-- YAML
@@ -380,8 +382,10 @@ Asynchronously read the next directory entry via readdir(3) as an
380382
After the read is completed, the `callback` will be called with an
381383
[`fs.Dirent`][], or `null` if there are no more directory entries to read.
382384

383-
_Directory entries returned by this function are in no particular order as
384-
provided by the operating system's underlying directory mechanisms._
385+
Directory entries returned by this function are in no particular order as
386+
provided by the operating system's underlying directory mechanisms.
387+
Entries added or removed while iterating over the directory may or may not be
388+
included in the iteration results.
385389

386390
### dir.readSync()
387391
<!-- YAML
@@ -395,8 +399,10 @@ Synchronously read the next directory entry via readdir(3) as an
395399

396400
If there are no more directory entries to read, `null` will be returned.
397401

398-
_Directory entries returned by this function are in no particular order as
399-
provided by the operating system's underlying directory mechanisms._
402+
Directory entries returned by this function are in no particular order as
403+
provided by the operating system's underlying directory mechanisms.
404+
Entries added or removed while iterating over the directory may or may not be
405+
included in the iteration results.
400406

401407
### dir\[Symbol.asyncIterator\]()
402408
<!-- YAML
@@ -413,8 +419,10 @@ The `null` case from `dir.read()` is handled internally.
413419

414420
See [`fs.Dir`][] for an example.
415421

416-
_Directory entries returned by this iterator are in no particular order as
417-
provided by the operating system's underlying directory mechanisms._
422+
Directory entries returned by this iterator are in no particular order as
423+
provided by the operating system's underlying directory mechanisms.
424+
Entries added or removed while iterating over the directory may or may not be
425+
included in the iteration results.
418426

419427
## Class: fs.Dirent
420428
<!-- YAML

0 commit comments

Comments
 (0)