GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: adds 'close' events to fs.ReadStream and fs.WriteStream · nodejs/node@33f24c8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • fs.md
    • stream.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ Stop watching for changes on the given `fs.FSWatcher`.
151151

152152
Emitted when the ReadStream's file is opened.
153153

154+
### Event: 'close'
155+
156+
Emitted when the `ReadStream`'s underlying file descriptor has been closed
157+
using the `fs.close()` method.
158+
154159
### readStream.path
155160

156161
The path to the file the stream is reading from as specified in the first
@@ -238,6 +243,11 @@ on Unix systems, it never was.
238243

239244
Emitted when the WriteStream's file is opened.
240245

246+
### Event: 'close'
247+
248+
Emitted when the `WriteStream`'s underlying file descriptor has been closed
249+
using the `fs.close()` method.
250+
241251
### writeStream.bytesWritten
242252

243253
The number of bytes written so far. Does not include data that is still queued
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+11-1Lines changed: 11 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ Emitted when the stream and any of its underlying resources (a file
160160
descriptor, for example) have been closed. The event indicates that
161161
no more events will be emitted, and no further computation will occur.
162162

163-
Not all streams will emit the `'close'` event.
163+
Not all streams will emit the `'close'` event as the `'close'` event is
164+
optional.
164165

165166
#### Event: 'data'
166167

@@ -573,6 +574,15 @@ Examples of writable streams include:
573574
* [child process stdin][]
574575
* [`process.stdout`][], [`process.stderr`][]
575576

577+
#### Event: 'close'
578+
579+
Emitted when the stream and any of its underlying resources (a file descriptor,
580+
for example) have been closed. The event indicates that no more events will be
581+
emitted, and no further computation will occur.
582+
583+
Not all streams will emit the `'close'` event as the `'close'` event is
584+
optional.
585+
576586
#### Event: 'drain'
577587

578588
If a [`stream.write(chunk)`][stream-write] call returns `false`, then the

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.