-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
ruby -rtempfile -e 'Tempfile.open("txt") { |f| $path = f.path }; p File.exist?($path)'
true
but it should be false
.
This means even after the block finishes to execute the file still exists on a disk
And this might or not be addressed by finalization much later on.
This is inconsistent with the resource block pattern and e.g. File.open
.
Since the block creates the file, it should also delete it, so there are no leftovers after the block.
How about using close!
instead of close
in
Line 293 in ec3dd03
tempfile.close |
Found by ruby/spec@d347e89 and the leak detector.
Metadata
Metadata
Assignees
Labels
No labels