This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Chetan Sanghi

Greenhorn
+ Follow
since Jul 30, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chetan Sanghi

Hi All

I am using Runtime.exec() to execute some commands, capture the output of the command and process it. In my case the output is in XML format and output can be very large i.e. upto 11-15 MB for a command.

First I created a command string which contained full path to command I want to execute, command name, arguments and redirect file name. For eg
<command_path>/<command_name> <list_of_arguments> >> <redirect_file_name>

Using Runtime.exec(String) version it did not work as parser have problem giving redirect symbol as parser assumes its also an argument for command.

Then I tried another approach where I just execute the command and get the large XML output and write it myself to a file in chunks of 8K buffer. I get the Process.getInputStream() and use BufferedWriter to write it out myself.



This works but after a while I get out of memory error for my application.

I was wondering if somebody who has experience handling large output from commands using Runtime.exec on Unix and Windows can advice or help me.

My email id is xxx@xxx

Thanks in advance.

[please use the forum, not email - thanks, Ilja]
[ August 17, 2005: Message edited by: Ilja Preuss ]
14 years ago
Passed. I am in Longmont Colorado.

Thanks a much to Richard for his great book.
Can you tell us about the format/pattern of the exam?

Thanks in advance.

--Chetan
Hi

How can I try it repeatdly?

--Chetan
Hi

How can I try it repeatdly?

--Chetan
Hi All

What will be the pattern of the exam? Multiple choice question, description questions or what? Does anybody have an idea?

--Chetan
Hi
I passed the SCJP 1.4 with 96%. Now I am planning to prepare for SCWCD and beta exam for Web Services. For SCJP I used :
1. A Programmer's Guide to Java Certification: Khalid Mughal, Rolf Rasmussen
2.Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)
3. Whizlabs Simulator for SCJP.
All were of great help and I learned a lot besides passing the exam.
Bye for now.
Chetan
16 years ago