java Inputstraemreader problem
Hi ,
I am trying to exceute a command in java and try to read the output line by line. Sting string1=new String("ls" , "-l" ,filenam); Process p=Runtime.getRuntime().exc(str1,null,dir) BufferReader line_ls=new BufferedReader(newInputStreamReader(p.getInputStream()); System.out.println(line_ls.ready()); The ouput is false this means the input stream is blank.But since the program is not throwing io exception the command is exceuting. I dont understand why the inputstream is blank. Please advice |
use the String[] argument constructor:
Code:
String[] s = new String[] { "ls", "-l", "/home/me"}; |
All times are GMT -5. The time now is 08:12 AM. |