//여기에 코드를 입력하세요
final File directory=new File(System.getProperty("java.io.tmpdir"));
ftpUtil.download(String.valueOf(directory), file);
Process p =null;
try {
ArrayList<String> cmd = new ArrayList<String>();
cmd.add("cmd");
cmd.add("/c");
cmd.add(directory+"\\"+file);
final ProcessBuilder pb = new ProcessBuilder(cmd);
pb.start().waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
위의 코드로 디버깅하면 ftpUtil(다른 클래스)을 이용해 가져온 파일(다운로드받은 외부파일)을 processBuilder로 실행하고 종료하기 전까지 waitFor()에서 걸려야하는데 외부파일을 실행하고 waitFor()에서 f6 누르면 그냥 넘어가 버리네요..
그리고 이상한게 한글, 텍스트 파일은 되는데 이미지파일, ms오피스 파일은 안됩니다.
이거 왜 그런건가요? 참고로 에러는 없습니다.
댓글 입력