Originally posted by Henry Wong:
The way it is executed, it may not have opened anywhere. To do that, you need to execute a shelltool or xterm first -- which then can run the "vi" command.
Henry
thanx for answering,,
what do you mean by you need to execute a shelltool or xterm first???
any example code plz???
I'm writing a console application that draw a screen and show all of it's contents files "available files" the user will choose the wanted file with arrows,, and when his/her wanted file is highlighted he can press return "enter" to open his/her file with the "vi" editor.....
i wrote this for proop of concepts
************
Runtime rt = Runtime.getRuntime();
Process ps = rt.exec("vi test.txt");
OutputStream os = ps.getOutputStream();
InputStream is = ps.getInputStream();
DataOutputStream dos = new DataOutputStream(os);
dos.writeBytes("i");
dos.writeBytes("test");
dos.writeBytes("\u001B");
dos.writeBytes(":wq\n");
dos.flush();
ps.waitFor();
dos.close();
System.out.println(ps.exitValue());
****************
and a "test.txt" file has been created with a inner-text "test".....
i don't want to get the output stream for the Process to wrtie on the file,,, i hope if i can display it for theuser to do his/her modifications
thanx again
[ December 29, 2005: Message edited by: Raed Qudaisat ]