From: nobu.nokada@... Date: 2004-06-22T08:32:06+09:00 Subject: Re: Cleaning up IO#popen Hi, At Mon, 21 Jun 2004 22:02:32 +0900, evanm@frap.net wrote in [ruby-talk:104243]: > > > * can't bypass the shell > > > > In 1.9, it can as well as Kernel#system. > > Really? I went and grabbed ruby-1.9-rodc-20040114.tgz to check it out, and > the docs say it's the same. Is there a better place to find this information? Sorry, I've forgotten to update the document. > Is the mode argument gone? Is the magic "-" value gone? Both are still there. You can give arguments as an Array. e.g.: IO.popen(%w[echo |arguments| contain shell's "chars"], "r") > > > While looking around for ways to improve on it I came across the Open3 > > > module in the stdlib, which has a much more "ruby" interface. Based mostly on > > > that, I redid some methods that could replace IO.popen (and put popen3 in IO > > > at the same time, which is where it probably belongs) > > > > I don't feel that Open3 is more ruby-like, but it's rather > > perlish. > > To me, magic values in a string are hackish. popen('-') logically is and should > be an entirely separate function. I can't really comment on the new version of > popen that you're referencing as I can't find any information on it. How does > it work? What is its args? Does it drop the '-' and mode arguments? I'm not sure they are really evil. At Mon, 21 Jun 2004 06:06:02 +0900, evanm@frap.net wrote in [ruby-talk:104194]: > * takes a "mode string" arg for what really should be a separate function > * takes a "-" as a magic value for what really should be a separate function Do you suggest to provide all possible combinations? -- Nobu Nakada