From 7f6ea837887a259571f4d2b8c2adcd7e688887f0 Mon Sep 17 00:00:00 2001 From: robberfree Date: Sun, 3 Nov 2024 00:55:53 +0800 Subject: [PATCH] doc: add write flag when open file as the demo code's intention PR-URL: https://github.com/nodejs/node/pull/54626 Reviewed-By: James M Snell Reviewed-By: Jake Yuesong Li --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 9eadee899310e7..8dc5173500e623 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -3731,7 +3731,7 @@ class WriteStream extends Writable { this.fd = null; } _construct(callback) { - fs.open(this.filename, (err, fd) => { + fs.open(this.filename, 'w', (err, fd) => { if (err) { callback(err); } else {