@@ -2553,7 +2553,7 @@ fs.readFile('<directory>', (err, data) => {
2553
2553
automatically.
2554
2554
3 . The reading will begin at the current position. If the file size is
2555
2555
10 bytes and if six bytes are already read with this file descriptor, then
2556
- ` readFile ` will return only the rest of the four bytes.
2556
+ ` readFile() ` will return only the rest of the four bytes.
2557
2557
2558
2558
The ` fs.readFile() ` function buffers the entire file. To minimize memory costs,
2559
2559
when possible prefer streaming via ` fs.createReadStream() ` .
@@ -3547,12 +3547,12 @@ fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
3547
3547
1 . Any specified file descriptor has to support writing.
3548
3548
2 . If a file descriptor is specified as the ` file ` , it will not be closed
3549
3549
automatically.
3550
- 3 . The writing will begin at the beginning of the file. If the file size
3551
- is 10 bytes and if six bytes are written with this file descriptor, then
3552
- ` writeFile ` will return six bytes newly written and four bytes from the file.
3553
- For example, if the file already had ` 'Hello World' ` and the newly written
3554
- content is ` 'Aloha' ` , then the contents of the file would be ` 'Aloha World ' ` ,
3555
- rather than just ` 'Aloha' ` .
3550
+ 3 . The writing will begin at the beginning of the file. If the file size is 10
3551
+ bytes and if six bytes are written with this file descriptor, then the file
3552
+ contents would be six newly written bytes and four bytes which were already
3553
+ there in the file from position seven to ten. For example, if the file already
3554
+ had ` 'Hello World' ` and the newly written content is ` 'Aloha' ` , then the
3555
+ contents of the file would be ` 'Aloha World' ` , rather than just ` 'Aloha' ` .
3556
3556
3557
3557
It is unsafe to use ` fs.writeFile() ` multiple times on the same file without
3558
3558
waiting for the callback. For this scenario, [ ` fs.createWriteStream() ` ] [ ] is
0 commit comments