Hi,
I would like to launch a process (external executable) and raise an
exception if I cannot read any output from it on the stdout.
Is that possible?
Thanks in advance
def execute_mencoder(command)
IO.popen(command) do |pipe|
pipe.each("\r") do |line|
puts line
end
end
raise MediaFormatException if $?.exitstatus != 0
end
Hi,
I would like to launch a process (external executable) and raise an
exception if I cannot read any output from it on the stdout.
Is that possible?
Thanks in advance
def execute_mencoder(command)
IO.popen(command) do |pipe|
pipe.each("\r") do |line|
puts line
end
end
raise MediaFormatException if $?.exitstatus != 0
end
--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama
Ok, we discussed about that but it was in another thread.
So, it's not even possible to detect that an external exe launched is
become
a zombie process?
Do I have to resort to threads?
Thans again
Hi, still on the subject I'm trying to understand if under Windows
I can emit and trap custom signals from two processes.
It should be something like this:
open("|-", "r") do |child|
if child
child.each("\n") do |line|
puts line
# emit signal
end
child.close
else
exec("ls", "-l")
# trap signal checking a timeout
# if signal not received for more than 10 secs close child\
# and go on
end
end
Is there a way to implement what specified in the commented lines?