Tanaka Akira wrote:
> In article <4a8e5e433964c_2103af42194571e / redmine.ruby-lang.org>,
>   Hongli Lai <redmine / ruby-lang.org> writes:
> 
>> Tempfile can support this in a portable manner by recommending applications to use it as follows:
>>
>> 1. Create the file.
>> 2. Unlink it if possible (i.e. only on POSIX systems).
>> 3. Use the file handle to do things. It doesn't matter whether the previous unlink action succeeded, but the file handle must remain open because the app is going to do some work with it.
>> 4. When done, close the file handle.
>> 5. If the unlink action in #2 failed, then unlink it now.
> 
> Why we don't have a method to do it?
> 
> For example, Tempfile.anonymous {|io| ... }.

Good idea, I can add that too.

For now, what do you think about the current changes?

Regards,
Hongli Lai