|
-
stdout stderr synchronization
Dear users,
i am trying to develop a front end to a linux based program. i am using swing (j2sdk 1.4.2) for this purpose. the gui part of it works fine and i could manage to get the program running on my linux system using getRuntime().exec(). And I would like to pipe the output back to the gui window and display it in a non-editable textarea. The program writes output both to the stdout and stderr streams. i could read both the streams using the getOutputStream() and getErrorStream() methods. and i have no problems getting it back to the gui window. but my problem is synchronization. the program writes to these two output streams, alternately. so, if i read one of the streams completely and go to the other, the output i would endup displaying in my gui window would be out of order, as compared to what i would read, had i run the program on the command line (independent of the gui window). so, is there any way of threading, so that i can read from the standard output streams of the program, in such a way that the output in my gui window conforms with the order it follows on the command line? Precisely, i would like to know how to detect the beginning of a stream, and how to react to minor pauses in the streams.
any help would be greatly appreciated.
thanks in anticipation.
Similar Threads
-
By himagiri in forum .NET
Replies: 1
Last Post: 01-02-2006, 10:24 PM
-
By tiamatloc in forum VB Classic
Replies: 6
Last Post: 03-15-2005, 02:45 PM
-
By notmycomputer in forum .NET
Replies: 0
Last Post: 04-22-2003, 11:26 AM
-
By Joe Shields in forum VB Classic
Replies: 14
Last Post: 04-26-2001, 03:35 PM
-
By Joe Shields in forum VB Classic
Replies: 0
Last Post: 04-25-2001, 03:11 PM
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