From 55822cfbc5c270fb12293c376fe9dafb10d1cccb Mon Sep 17 00:00:00 2001 From: "Sakthipriyan Vairamani (thefourtheye)" Date: Wed, 26 Dec 2018 13:09:36 +0530 Subject: [PATCH] doc: update behaviour of fs.writeFile As per the decision in https://github.com/nodejs/node/issues/23433, the `fs.writeFile` will always write from the current position if it is used with file descriptors. This patch updates it. Ref: https://github.com/nodejs/node/pull/23709 --- doc/api/fs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 1ab47d17602e00..edab0ed9cb23b0 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3605,10 +3605,10 @@ recommended. 1. Any specified file descriptor has to support writing. 2. If a file descriptor is specified as the `file`, it will not be closed automatically. -3. The writing will begin at the beginning of the file. For example, if the -file already had `'Hello World'` and the newly written content is `'Aloha'`, -then the contents of the file would be `'Aloha World'`, rather than just -`'Aloha'`. +3. The writing will begin at the current position. For example, if the string +`'Hello'` is written to the file descriptor, and if `', World'` is written with +`fs.writeFile()` to the same file descriptor, the contents of the file would +become `'Hello, World'`, instead of just `', World'`. ## fs.writeFileSync(file, data[, options])