on 07-17-2008 1:36 PM
Hi,
I want to move files from one directory to another by using unix command in custom module development.
Is it possible in module developement.If it is yes please provide me solution.
thanks in advance
regards
rams....
Use the code below:
String command = new StringBuffer("mv -f").append(' ').append(
sourceFolder).append('/').append(fileName).append(' ').append(
errorFolder).toString();
try
{
Runtime.getRuntime().exec(command);
}
catch (IOException e)
{
throw new ModuleException(e);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any Solution..........
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any Solution..........
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Yes you can run Unix commands in Java program like this -
class StartShut1
{
public static void main(String[] args)
{
try {
String cmd="command.sh";
System.out.println(" the cmd is: "+cmd);
Process p =Runtime.getRuntime().exec(cmd);
int i = p.waitFor();
System.out.println("Exit value of process is "+j);
System.out.println("Output of the Cmd is : "+i);
String s=null;
}//main
}//class
Regards,
Kishore
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.