Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gireeshpunathil committed Aug 14, 2018
1 parent 4dfe0b3 commit 9226e41
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1464,14 +1464,14 @@ the specified file descriptor. This means that no `'open'` event will be
emitted. `fd` should be blocking; non-blocking `fd`s should be passed to
[`net.Socket`][].

Also note that the blocking fd, if pointing to a character device (such as
keyboard or sound card) can potentially block the main thread on stream close.
This is because these devices do not produce EOF character as part of their data
The blocking `fd`, if pointing to a character device (such as keyboard or
sound card) can potentially block the main thread on stream close. This is
because these devices do not produce EOF character as part of their data
flow cycle, and thereby exemplify endless streams. As a result, they do not
respond to `stream.close()` call. A workaround is to close the stream first
using `stream.close()` and then push a random character into the stream, issue
a single read. This unblocks the reader thread, leads to the completion of the
data flow cycle, and the actual closing of the stream.
respond to `stream.close()`. A workaround is to close the stream first
using `stream.close()` and then push a random character into the stream, and
issue a single read. This unblocks the reader thread, leads to the completion
of the data flow cycle, and the actual closing of the stream.

```js
const fs = require('fs');
Expand Down

0 comments on commit 9226e41

Please sign in to comment.