From 5ea6cf9ee13234313e297bf7762ac130f712cf25 Mon Sep 17 00:00:00 2001 From: aamine Date: Thu, 11 Dec 2003 10:54:17 +0000 Subject: catch all SystemCallErrors. * lib/fileutils.rb (mkdir_p): catch all SystemCallErrors (mkdir("C:\") causes EACCESS on Windows 2000/NTFS). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/fileutils.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/fileutils.rb') diff --git a/lib/fileutils.rb b/lib/fileutils.rb index eaa5434d3..d9eba1931 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 -- cgit