GeezerVison is showing github.com — doc: clarify that fs streams expect blocking fd · nodejs/node@3f4409e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/fs.markdown +4-1Lines changed: 4 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -307,6 +307,8 @@ start at 0. The `encoding` can be any one of those accepted by [Buffer][]. |
307 | 307 |
|
308 | 308 | If `fd` is specified, `ReadStream` will ignore the `path` argument and will use |
309 | 309 | the specified file descriptor. This means that no `open` event will be emitted. |
| 310 | +Note that `fd` should be blocking; non-blocking `fd`s should be passed to |
| 311 | +`net.Socket`. |
310 | 312 |
|
311 | 313 | If `autoClose` is false, then the file descriptor won't be closed, even if |
312 | 314 | there's an error. It is your responsibility to close it and make sure |
@@ -341,7 +343,8 @@ default mode `w`. The `defaultEncoding` can be any one of those accepted by [Buf |
341 | 343 |
|
342 | 344 | Like `ReadStream` above, if `fd` is specified, `WriteStream` will ignore the |
343 | 345 | `path` argument and will use the specified file descriptor. This means that no |
344 | | -`open` event will be emitted. |
| 346 | +`open` event will be emitted. Note that `fd` should be blocking; non-blocking |
| 347 | +`fd`s should be passed to `net.Socket`. |
345 | 348 |
|
346 | 349 | If `options` is a string, then it specifies the encoding. |
347 | 350 |
|
|