Skip to content

Commit

Permalink
catch all SystemCallErrors.
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aamine committed Dec 11, 2003
1 parent eb5a174 commit 5c3abcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Thu Dec 11 19:53:03 2003 Minero Aoki <[email protected]>

* 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 <[email protected]>

* lib/fileutils.rb (mkdir_p): check if it is a directory after
Expand Down
4 changes: 2 additions & 2 deletions lib/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def mkdir_p(list, options = {})
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
Expand All @@ -179,7 +179,7 @@ def mkdir_p(list, options = {})
stack.reverse_each do |path|
begin
Dir.mkdir path, mode
rescue Errno::EEXIST => err
rescue SystemCallError => err
raise unless File.directory?(path)
end
end
Expand Down

0 comments on commit 5c3abcd

Please sign in to comment.