Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Writing an empty buffer to stdout can close the pipe #985

Open
PeterReid opened this issue Nov 5, 2013 · 1 comment
Open

Writing an empty buffer to stdout can close the pipe #985

PeterReid opened this issue Nov 5, 2013 · 1 comment
Labels

Comments

@PeterReid
Copy link

Writing an empty buffer to stdout from node caused a ReadFile call on the other end of the pipe to return FALSE and then triggered an assert in node. This only seems to happen if the pipe is being read from synchronously -- overlapped IO worked fine. The most likely suspect looks like WriteFile being called with nNumberOfBytesToWrite = 0.

Quoth msdn:

A value of zero specifies a null write operation. The behavior of a null write operation depends on the underlying file system or communications technology.

The null write operation here seems to be closing the stream.

@ryancole
Copy link
Contributor

ryancole commented May 3, 2014

Can you provide an example?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants