D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
FileUtils
/
Filename :
mkdir_p-i.ri
back
Copy
U:RDoc::AnyMethod[iI"mkdir_p:ETI"FileUtils#mkdir_p;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I":Creates directories at the paths in the given +list+ ;TI"+(a single path or an array of paths), ;TI"3also creating ancestor directories as needed; ;TI"Areturns +list+ if it is an array, <tt>[list]</tt> otherwise.;To:RDoc::Markup::BlankLine o; ; [I"%Argument +list+ or its elements ;TI"Kshould be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].;T@o; ; [ I"NWith no keyword arguments, creates a directory at each +path+ in +list+, ;TI"1along with any needed ancestor directories, ;TI"1by calling: <tt>Dir.mkdir(path, mode)</tt>; ;TI")see {Dir.mkdir}[rdoc-ref:Dir.mkdir]:;T@o:RDoc::Markup::Verbatim; [I"PFileUtils.mkdir_p(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"] ;TI"CFileUtils.mkdir_p('tmp4/tmp5') # => ["tmp4/tmp5"] ;T:@format0o; ; [I"Keyword arguments:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"N<tt>mode: <i>mode</i></tt> - also calls <tt>File.chmod(mode, path)</tt>; ;TI"+see {File.chmod}[rdoc-ref:File.chmod].;To;;0; [o; ; [I"7<tt>noop: true</tt> - does not create directories.;To;;0; [o; ; [I";<tt>verbose: true</tt> - prints an equivalent command:;T@o;; [I"5FileUtils.mkdir_p(%w[tmp0 tmp1], verbose: true) ;TI"AFileUtils.mkdir_p(%w[tmp2 tmp3], mode: 0700, verbose: true) ;T; 0o; ; [I"Output:;T@o;; [I"mkdir -p tmp0 tmp1 ;TI"mkdir -p -m 700 tmp2 tmp3 ;T; 0o; ; [I"IRaises an exception if for any reason a directory cannot be created.;T@o; ; [I"OFileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.;T@o; ; [I"Related: FileUtils.mkdir.;T: @fileI"lib/fileutils.rb;T:0@omit_headings_from_table_of_contents_below000[[I"mkpath;To;; [ ;@I;0[I" makedirs;To;; [ ;@I;0I"/(list, mode: nil, noop: nil, verbose: nil);T@IFI"FileUtils;TcRDoc::NormalModule00