Lines Matching refs:stdio

236 function stdioStringToArray(stdio, channel) {
239 switch (stdio) {
242 case 'pipe': ArrayPrototypePush(options, stdio, stdio, stdio); break;
245 throw new ERR_INVALID_ARG_VALUE('stdio', stdio);
295 // If any of the stdio streams have not been touched,
311 const stdio = subprocess.stdio;
313 if (stdio == null) return;
315 for (let i = 0; i < stdio.length; i++) {
316 const stream = stdio[i];
353 // If no `stdio` option was given - use default
354 let stdio = options.stdio || 'pipe';
356 stdio = getValidStdio(stdio, false);
358 const ipc = stdio.ipc;
359 const ipcFd = stdio.ipcFd;
360 stdio = options.stdio = stdio.stdio;
400 // because we won't be able to set up the stdio file descriptors.
405 for (i = 0; i < stdio.length; i++) {
406 const stream = stdio[i];
421 for (i = 0; i < stdio.length; i++) {
422 const stream = stdio[i];
456 this.stdin = stdio.length >= 1 && stdio[0].socket !== undefined ?
457 stdio[0].socket : null;
458 this.stdout = stdio.length >= 2 && stdio[1].socket !== undefined ?
459 stdio[1].socket : null;
460 this.stderr = stdio.length >= 3 && stdio[2].socket !== undefined ?
461 stdio[2].socket : null;
463 this.stdio = [];
465 for (i = 0; i < stdio.length; i++)
466 ArrayPrototypePush(this.stdio,
467 stdio[i].socket === undefined ? null : stdio[i].socket);
979 function getValidStdio(stdio, sync) {
984 if (typeof stdio === 'string') {
985 stdio = stdioStringToArray(stdio);
986 } else if (!ArrayIsArray(stdio)) {
987 throw new ERR_INVALID_ARG_VALUE('stdio', stdio);
990 // At least 3 stdio will be created
992 // stdio.reduce() would skip the sparse elements of stdio.
994 while (stdio.length < 3) ArrayPrototypePush(stdio, undefined);
996 // Translate stdio into C++-readable form
998 stdio = ArrayPrototypeReduce(stdio, (acc, stdio, i) => {
1007 if (stdio == null) {
1008 stdio = i < 3 ? 'pipe' : 'ignore';
1011 if (stdio === 'ignore') {
1013 } else if (stdio === 'pipe' || stdio === 'overlapped' ||
1014 (typeof stdio === 'number' && stdio < 0)) {
1016 type: stdio === 'overlapped' ? 'overlapped' : 'pipe',
1025 } else if (stdio === 'ipc') {
1043 } else if (stdio === 'inherit') {
1048 } else if (typeof stdio === 'number' || typeof stdio.fd === 'number') {
1051 fd: typeof stdio === 'number' ? stdio : stdio.fd,
1053 } else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
1054 getHandleWrapType(stdio._handle)) {
1055 const handle = getHandleWrapType(stdio) ?
1056 stdio :
1057 getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle;
1063 _stdio: stdio,
1065 } else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
1068 throw new ERR_INVALID_SYNC_FORK_INPUT(inspect(stdio));
1073 throw new ERR_INVALID_ARG_VALUE('stdio', stdio);
1079 return { stdio, ipc, ipcFd };