我正在使用进程类来运行这个命令
/sdcard/file1.mpg /sdcar/file2.mpg > /sdcard/out.mpg
这是我尝试的方法:
Process processx = Runtime.getRuntime().exec(new String[] {"cat","/sdcard/file1.mpg /sdcard/file2.mpg > /sdcard/out.mpg" });
BufferedReader in = new BufferedReader(new InputStreamReader(processx.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
// Waits for the command to finish.
processx.waitFor();
该命令在终端上有效,但在我尝试上述操作时无效,任何人都可以看到原因吗?