diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-15 05:50:45 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-15 05:50:45 +0000 |
commit | 21e22f8f969c5a7314a08a9d3e5d591ae5914d5c (patch) | |
tree | a7236f9469b1b25771e18bd54abaa9a0fd8bb0fa | |
parent | ab59e8a6cc24d1d85383190540858ee6cce2628a (diff) |
* lib/pathname.rb (Pathname#unlink): unlink a symlink to a directory
was failed. [ruby-core:4992]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/pathname.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Sun May 15 14:35:46 2005 Tanaka Akira <[email protected]> + + * lib/pathname.rb (Pathname#unlink): unlink a symlink to a directory + was failed. [ruby-core:4992] + Sun May 15 09:57:30 2005 Nobuyoshi Nakada <[email protected]> * win32/win32.c (unixtime_to_filetime): deal with DST. diff --git a/lib/pathname.rb b/lib/pathname.rb index 19630415c1..bac540230f 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -860,10 +860,10 @@ class Pathname # * mixed * # Removes a file or directory, using <tt>File.unlink</tt> or # <tt>Dir.unlink</tt> as necessary. def unlink() - if FileTest.directory? @path - Dir.unlink @path - else + begin File.unlink @path + rescue Errno::EISDIR + Dir.unlink @path end end alias delete unlink |