- 299 名前:デフォルトの名無しさん [2008/01/22(火) 22:19:00 ]
- 大変失礼いたしました。
>>295を >>290に対する返答と勘違いしました、申し訳ありません。 試しに書いたプログラムです。 ProcessBuilder pb = new ProcessBuilder("C://cygwin/Cygwin.bat","ls"); try { Process p = pb.start(); InputStream stdIn = p.getInputStream(); InputStream errIn = p.getErrorStream(); int c; while ((c = stdIn.read()) != -1) { System.out.print((char)c); } stdIn.close(); while ((c = errIn.read()) != -1) { System.out.print((char)c); } errIn.close(); int ret = p.waitFor(); System.out.println("process exited with value : " + ret); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } 出力は一切ありませんでした。
|

|