From: Yu-raku-an Date: 2008-01-16T00:07:17+09:00 Subject: Re: IO redirection Hi, Use p exec('echo', '1') instead of exec('echo', '1') And you will get '1\n' in the specified file. Thank you. Daniel Brumbaugh Keeney wrote: > Basically, I need to redirect the results of exec. While I can > $stdout.reopen(file), and I can redefine $stdout to anything with a > `write' method, I seem to be unable to send the results of exec to > anything within my script (so exec('echo','1') would send "1\n" to a > method). I tried to subclass IO, but then I get > :in `reopen': uninitialized stream (IOError) > > Any ideas? > > Daniel Brumbaugh Keeney > > > -------------------------------------- Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar http://pr.mail.yahoo.co.jp/toolbar/