java Runtime.getRunTime().exec & wildcards?

后端 未结 5 1251
余生分开走
余生分开走 2020-11-30 08:21

i\'m trying to remove junk files by using

Process p = Runtime.getRuntime().exec();

it works fine as long as i do not use wildcards, i.e. th

5条回答
  •  执念已碎
    2020-11-30 08:45

    After a lot of searching I found this: http://www.coderanch.com/t/423573/java/java/Passing-wilcard-Runtime-exec-command

    Runtime.exec(new String[] { "sh", "-c", "rm /tmp/ABC*" });
    

提交回复
热议问题