From: Robert Klemme Date: 2003-02-25T17:52:08+09:00 Subject: Re: Threads, pipes, popen, whatever A simple solution seems to be this: Write a shell script like #! /bin/sh -f echo "$*" | your_filter # or echo "$1" | your_filter Then, from within ruby result = system("your_script", "a string") # result is boolean Normally you would use IO.popen but I can't see a way to access the exit status of the process directly. Something like this comes to mind, but I could not convice "popen" to behave like documented, because "-" is not treated as documented def f( word ) result = nil IO.popen("-", "r+") do |io| if io # parent process io.puts word result = io.readlines.shift.chomp else # child process puts system("more") end end result == "true" end Any other hints? robert "Albert Wagner" schrieb im Newsbeitrag news:20030224054714.04780080.alwagner@tcac.net... > I have never before had occasion to do the following kind of problem, so > I haven't a clue where to start. I have a C filter that accepts a > string on stdin and returns a boolean based on it's analysis of the > string. In a ruby program I want to pass a list of strings, one at a > time, to the filter and take appropriate action based on each return > value. Could someone point me in the right direction? I have never > worked with threads or pipes before. > > Albert >