Ruby/ライブラリTop / Ruby / ライブラリSTDOUT.reopenの謎begin stdout = STDOUT.clone STDOUT.reopen('cannot_write_file', 'w') ensure STDOUT.reopen(stdout) end みたいなことがしたいのだが、ファイルを開くのに失敗している場合、 Bad file descriptor (Errno::EBADF) reopen の時に一旦ファイルを開くと問題なく動く。 STDOUT.reopen( File.open('/tmp/not_writable', 'w') ) Net::HTTP挙動謎
RgplotRgplot gnuplot の制御を ruby で DataSet 以外の入力Gnuplot::Plot.new の第2引数が 'plot' なので、'plot sin(x),' などに書き換え。 |