-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I'm trying to use head to only get the first n bytes of output. See the following (contrived) example:
var procstream = require('procstreams');
procstream('cat', ['/dev/random'])
.pipe('head', ['--bytes=100'])
.data(function (err, stdout, stderr) {
console.log(stdout.length + ' bytes read');
});When that code is run, I get an unhandled error event:
events.js:72
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at errnoException (net.js:901:11)
at Pipe.onread (net.js:556:19)
I'm not much of a Linux shell guy but I assume head just closes the stream when enough data was read. It would be nice if procstream could handle these kinds of situations.
Metadata
Metadata
Assignees
Labels
No labels