- Joined
- May 23, 2011
- Messages
- 1
- Reaction score
- 0
Hi all,
I'm trying to execute a command using Process and to read and process the output. Here is the code:
Process p = Runtime.getRuntime().exec(cmd);
input = new BufferedReader (new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
...process line...
}
The problem is that some lines are getting partially overwritten by other lines, i.e. the output should be:
TMEmulation log_pseduo_allocation (34985) (2 45 76 89 90)
__divw clock timer (8273) (4 6 67 4 2)
and instead during the processing there are some lines that are read like this:
TMEmulation log_pseduo_allocation (34985) (2__divw 45clock 76timer (89 8273) 904) (6 67 4 2)
It's like the two lines got merged together.
I'm not expert in Java and I haven't found anything about it on the internet. Anybody knows what I'm doing wrong?
Thanks in advance,
Patricia
I'm trying to execute a command using Process and to read and process the output. Here is the code:
Process p = Runtime.getRuntime().exec(cmd);
input = new BufferedReader (new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
...process line...
}
The problem is that some lines are getting partially overwritten by other lines, i.e. the output should be:
TMEmulation log_pseduo_allocation (34985) (2 45 76 89 90)
__divw clock timer (8273) (4 6 67 4 2)
and instead during the processing there are some lines that are read like this:
TMEmulation log_pseduo_allocation (34985) (2__divw 45clock 76timer (89 8273) 904) (6 67 4 2)
It's like the two lines got merged together.
I'm not expert in Java and I haven't found anything about it on the internet. Anybody knows what I'm doing wrong?
Thanks in advance,
Patricia