From 5c3abcd043dca3794d68757a34640cb0ea9502b1 Mon Sep 17 00:00:00 2001 From: aamine Date: Thu, 11 Dec 2003 10:54:17 +0000 Subject: [PATCH] catch all SystemCallErrors. * lib/fileutils.rb (mkdir_p): catch all SystemCallErrors (mkdir("C:\") causes EACCESS on Windows 2000/NTFS). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/fileutils.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1b32dd575..38c1d8d4d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 11 19:53:03 2003 Minero Aoki + + * lib/fileutils.rb (mkdir_p): catch all SystemCallErrors. + (mkdir("C:\") causes EACCESS on Windows 2000/NTFS) + Thu Dec 11 19:08:02 2003 Minero Aoki * lib/fileutils.rb (mkdir_p): check if it is a directory after diff --git a/lib/fileutils.rb b/lib/fileutils.rb index eaa5434d39..d9eba19314 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -170,7 +170,7 @@ module FileUtils return *list if options[:noop] mode = options[:mode] || (0777 & ~File.umask) - list.map {|n| File.expand_path(n) }.each do |path| + list.each do |path| stack = [] until path == stack.last # dirname("/")=="/", dirname("C:/")=="C:/" stack.push path @@ -179,7 +179,7 @@ module FileUtils stack.reverse_each do |path| begin Dir.mkdir path, mode - rescue Errno::EEXIST => err + rescue SystemCallError => err raise unless File.directory?(path) end end