I am writing an application that sends commands to a unix shell.
I am not ever having any troubles with issuing cp and chmod commands (that i know of) but for some reason mv commands will not actually move the files i spedify?
My code can be show cased as follows:
import java.io.IOException;
public class ExecuteCommand {
public static void main(String[] args){
ExecuteCommand exec = new ExecuteCommand("cp /some/directory/file.txt /some/directory/of/mine/");
ExecuteCommand exec2 = new ExecuteCommand("chmod 666 /some/directory/of/mine/file.txt");
ExecuteCommand exec3 = new ExecuteCommand("mv /some/directory/of/mine/file.txt /some/directory/of/mine/subDirectory/");
}
public ExecuteCommand(String command) {
try {
System.out.println("EXECUTING!::" + command);
Process child = Runtime.getRuntime().exec(command);
} catch (IOException e) {
}
}
}
I have tried putting timers in between the commands with no progress being made to ensure that %100 of my commands are processed.
Please note that my code includes sample info, if some of the unix file system syntax is incorrect, forgive me, and please do not blame the problem on that.
If you need any further info please ask and i will provide asap
Thanks Guys =)