Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Java] ProcessBuilder Std/Err Streams
New Posts  All Forums:Forum Nav:

[Java] ProcessBuilder Std/Err Streams

post #1 of 2
Thread Starter 
I am setting up and creating a new thread to execute another program.

This new thread has a standard out and error stream.

I want both streams to be written to the same log file which is easy with the method "redirectErrorStream(true)"....

HOWEVER, I need to monitor the error stream... if anything comes through it, I want to report a process error.
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #2 of 2
Thats easy, just make a class that implements ProcessBuilder as a super.....

Then overload the method that handles error streams to do whatever you want before it does the normal stuff... leaving all other methods alone.....
Regen v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-3770K Asus p8z77-deluxe Asus Geforce GTX 590 samsung 4GB DDR3 
Hard DriveCoolingOSMonitor
Combined: 6.13 TB of space Silver Arrow SB-E Extreme Windows 8 Pro Asus VG278H 
KeyboardPowerCaseMouse
Overclock.net Ducky Keyboard Corsair AX1200 Corsair Obsidian 800D Logitech Performance MX 
AudioAudioAudioAudio
Onkyo TX-809NR KRK 10-3 Studio Mid-Field Monitors(Pair) HSU ULS-15 Subwoofer MOTO Microbook II 
AudioAudio
MXL v69 Mogami Edition Tube Microphone Rode PSA-1 Microphone Arm 
  hide details  
Reply
Regen v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-3770K Asus p8z77-deluxe Asus Geforce GTX 590 samsung 4GB DDR3 
Hard DriveCoolingOSMonitor
Combined: 6.13 TB of space Silver Arrow SB-E Extreme Windows 8 Pro Asus VG278H 
KeyboardPowerCaseMouse
Overclock.net Ducky Keyboard Corsair AX1200 Corsair Obsidian 800D Logitech Performance MX 
AudioAudioAudioAudio
Onkyo TX-809NR KRK 10-3 Studio Mid-Field Monitors(Pair) HSU ULS-15 Subwoofer MOTO Microbook II 
AudioAudio
MXL v69 Mogami Edition Tube Microphone Rode PSA-1 Microphone Arm 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Java] ProcessBuilder Std/Err Streams