From: "Pedro CĂ´rte-Real" Date: 2006-06-01T20:32:31+09:00 Subject: Re: Passing a string as stdin to a popen On 6/1/06, Robert Klemme wrote: > I suspect the error was caused because the process had terminated already: > > >> IO.popen("ls", "r+") {|io| sleep 5; io.write "test"} > Errno::EPIPE: Broken pipe > from (irb):1:in `write' > from (irb):1 > from (irb):1 > from :0 > > Does the process you start maybe not read its stdio? Or stop reading > after some time has passed without input? Where exactly do you get > the exception? Is it during read or write? Yes, that was it. I was passing some wrong options to the program and it was exiting without reading it's input. It's solved now. What I'm doing is running "xsltproc" to convert some XML into HTML with a XSLT. I guess a better idea would be to do it directly in ruby but ubuntu's libxslt-ruby1.8 seems to be broken. Pedro.