diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-10 13:26:38 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-10 13:26:38 +0000 |
| commit | 93cfd49f566646ec731dc9656dad120cc1ce075e (patch) | |
| tree | 275b26006e1e0d010aadc5d68abfa242b80d5eda /lib/fileutils.rb | |
| parent | 4eae350e1294e31bf8b9086e035992f712ef3204 (diff) | |
| download | ruby-93cfd49f566646ec731dc9656dad120cc1ce075e.tar.gz ruby-93cfd49f566646ec731dc9656dad120cc1ce075e.tar.xz ruby-93cfd49f566646ec731dc9656dad120cc1ce075e.zip | |
* lib/fileutils.rb (remove_dir): should handle symlink correctly. This patch is contributed by Christian Loew. [ruby-talk:94635]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/fileutils.rb')
| -rw-r--r-- | lib/fileutils.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb index c8f29c3d3..b3a146672 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -581,7 +581,9 @@ module FileUtils Dir.foreach(dir) do |file| next if /\A\.\.?\z/ === file path = "#{dir}/#{file}" - if File.directory?(path) + if File.symlink?(path) + remove_file path, force + elsif File.directory?(path) remove_dir path, force else remove_file path, force |
