Skip to content

doc: clarify the behavior of readFile with fd

Rodrigo Muino Tomonari requested to merge github/fork/seishun/doc-fd into master

Makes it explicit that readFile doesn't seek to the beginning.

This is related to #9671 (closed), but that issue is actually a combination of two issues.

  1. On Windows, fs.read/write always updates the current file position, but on other OSes it doesn't when an explicit offset is specified.
  2. fs.readFile reads from the current offset when called with an fd instead of from the beginning.

Fixing at least one of the above would fix @jorangreef's issue. I tried fixing the second one in #9699, but that broke Linux and Mac OS tests (see #10809). This PR clarifies that it's not a bug but a feature.

Not sure which of the above mentioned issues should be mentioned in the commit message, if any.

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Merge request reports

Loading