From: Sean O'Halpin Date: 2013-05-09T01:06:39+09:00 Subject: Re: File Problem with pty and irb Instead of running it from irb, have you tried running it using the ruby interpreter directly? E.g. ruby cmd.rb On Wed, May 8, 2013 at 2:32 PM, Admin Tensor wrote: > Sean O'halpin wrote in post #1108212: >> You're not waiting for the child process in cmd.rb so it's killed when >> the ruby process finishes. Try: >> >> require 'pty' >> @rbOut, @rbIn, @pid = PTY.spawn('mycode') >> Process.waitpid(@pid) >> >> Regards, >> Sean > > Hi Sean, > > Thank your for your suggestion. Actually when I tried that, even I > could not put commands into irb anymore and the namedpipe still gave > nothing: > > Screen 1: irb -r cmd.rb > (no prompt from the irb) > > Screen 2: cat < namedpipe > (nothing) > > mycode is a code that runs forever (a daemon, if you like). > > Best regards, > > Bill > > -- > Posted via http://www.ruby-forum.com/. >