summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 08:44:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 08:44:24 +0000
commit1b0f90ca333ddbf7ed57eba28465fbb922daa957 (patch)
tree47b47a035bcad5c857f1d90b41e9c14bf2e9bbf8 /lib/tempfile.rb
parentc4216a26e2c9b3754abc3225de1732c50803433b (diff)
* parse.y (string_content): turn off NODE_NEWLINE flag to avoid
unnecessary line trace for inlined expression. (ruby-bugs PR#1320) * numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 38a72e1..9333505 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -108,9 +108,13 @@ class Tempfile < DelegateClass(File)
# file.
def unlink
# keep this order for thread safeness
- File.unlink(@tmpname) if File.exist?(@tmpname)
- @@cleanlist.delete(@tmpname)
- @tmpname = nil
+ begin
+ File.unlink(@tmpname) if File.exist?(@tmpname)
+ @@cleanlist.delete(@tmpname)
+ @tmpname = nil
+ rescue Errno::EACCESS
+ # may not be able to unlink on Windows; just ignore
+ end
end
alias delete unlink