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