summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-11 10:54:17 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-11 10:54:17 +0000
commit5ea6cf9ee13234313e297bf7762ac130f712cf25 (patch)
treeb1ecae374a59c0e03992dd6e7ce5308e5b035343
parentc8aff659b1a78a4d08cfaa27e063df217dfb1ad6 (diff)
downloadruby-5ea6cf9ee13234313e297bf7762ac130f712cf25.tar.gz
ruby-5ea6cf9ee13234313e297bf7762ac130f712cf25.tar.xz
ruby-5ea6cf9ee13234313e297bf7762ac130f712cf25.zip
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
-rw-r--r--ChangeLog5
-rw-r--r--lib/fileutils.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a1b32dd57..38c1d8d4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 11 19:53:03 2003 Minero Aoki <aamine@loveruby.net>
+
+ * 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 <aamine@loveruby.net>
* lib/fileutils.rb (mkdir_p): check if it is a directory after
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