while(true) {
Process p = Runtime.getRuntime().exec("cmd");
DataOutputStream dos = new DataOutputStream(p.getOutputStream());
dos.write(cmd.getBytes());
dos.flush();
}
위와 같이 반복적으로 Process명령을 하고 종료하면 종료후에 미처 write못한 명령이
버퍼에 남아 종료후에도 일정시간동안 명령을 수행합니다.
os / Process 버퍼를 비우는 방법 또는 shell명령이 있으면 알려주십시오.
감사합니다.