-
what next to do in code?
I want to send ftp or telnet commands on the Unix command box. I want to connect to say ftp enter user name and password and then run "ls" command
Here is what I have written so far, code to ftp.
But when I run the program I do not know what has happened? How can I do the next stage like enter "user name" "password" and finally run "ls" command for unix?????????
import java.lang.*;
import java.io.*;
public class RuntimeFTP{
public static void main(String[] arg){
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "ftp.exe", "jaguar.wmin.ac.uk" };
try
{
Process child = rt.exec(callAndArgs);
child.waitFor();
System.out.println("Process exit code is: " + child.exitValue() );
}
catch(IOException e)
{
System.err.println("IOException starting process!");
}
catch(InterruptedException e)
{
System.out.println("Interrupted waiting for process!");
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks