From: Robert Klemme Date: 2007-04-19T22:30:06+09:00 Subject: Re: Executing program from ruby On 19.04.2007 15:21, Marcin Raczkowski wrote: > Hello i know there are several ways to execute from within ruby > but each one have their own problems: > > `` doesn't check if command /programm runs at all!, also it blocks untill > command returns, no bi-directional comunication > popen2,3,4 doesn't check if command exists at all ... it's not rising any > errors ... and happilly continues to run untill you try to write something to > pipe that leads to program that never even started > > only system() checks if command runs but it also returns false when programs > starts but returns anything other then 0 > > does anyone know good way to check if command exists then run it, return pid > for monitoring purposes and allow bidirectional comunication, then check exit > status ? > > open4 comes close to fulfilling all that but it doesn't rise (sample program > that tells you it'll doesn't eaither), not to mention compleate lack of > documentation. > > any expirience with open4? help? pointers? > mayby i'm simply missing some obvious way? popen and its derivatives? robert