Toshです。

昔RDのサンプルに書いたものを発掘。
ほとんどまつもとさんがtempfile.rbのコメントに書いたものをRD
に直しただけです。
あと、もしかしたら古いかも。


= class Tempfile The class for temporary files. * creates a temporary file, which name is "basename.pid.n" with mode "w+". * Tempfile objects can be used like IO object. * with tmpfile.close(true) created temporary files are removed. * created files are also removed on script termination. * with Tempfile#open, you can reopen the temporary file. * file mode of the temporary files are 0600. == super class: ((<(({SimpleDelegator}))>)) == delegating class: ((<(({File}))>)) == class methods: --- Tempfile.new(basename[, tempdir]) --- Tempfile.open(basename[, tempdir]) Create tempfile named "((|basename|))((|pid|)).((|n|))". ((|tempdir|)) is directory for tempfile. == methods: --- Tempfile#close([real]) Close tempfile. If ((|real|)) isn't (({false})), tempfile is deleted immediately, if not, tempfile is deleted implicitly when GC sweeped this object. --- Tempfile#open Reopen tempfile. --- Tempfile#path Return path of tempfile. =end
--- Tosh Toshiro Kuwabara