Comment detail

入出力の中継 (Nested Flatten)
 Java による他の投稿とほぼ同じ内容。
 WSH での挑戦は atEndOfStream が挙動不審なため断念。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function pipe(i, o){
  for(var is = i.inputStream, os = o.outputStream, b; (b = is.read()) != -1; os.write(b));
  os.close();
  o.waitFor();
  i.destroy();
}
if(arguments.length < 2) quit();
with(java.lang.Runtime.runtime) var pp = [exec(arguments[0]), exec(arguments[1])];
spawn(function(){ pipe(pp[0], pp[1]) });
spawn(function(){ pipe(pp[1], pp[0]) });

Index

Feed

Other

Link

Pathtraq

loading...