End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
FileUtils.mkdir
mkdir(list, mode: nil, noop: nil, verbose: nil)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/fileutils.rb, line 180
def mkdir(list, mode: nil, noop: nil, verbose: nil)
list = fu_list(list)
fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
return if noop
list.each do |dir|
fu_mkdir dir, mode
end
end
Creates one or more directories.
Example
FileUtils.mkdir 'test' FileUtils.mkdir %w(tmp data) FileUtils.mkdir 'notexist', noop: true # Does not really create. FileUtils.mkdir 'tmp', mode: 0700