blob: 720bcc9de458bae5bb8d0b00ab5c583dcec1ccba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const common = require('../common');
const assert = require('assert');
const net = require('net');
const fs = require('fs');
process.stdout.write('hello world\r\n');
var stdin = process.openStdin();
stdin.on('data', function(data) {
process.stdout.write(data.toString());
});
stdin.on('end', function() {
// If stdin's fd was closed, the next open() call would return 0.
var fd = fs.openSync(process.argv[1], 'r');
assert(fd > 2);
fs.closeSync(fd);
});
|