D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
FileUtils
/
Filename :
rm_r-i.ri
back
Copy
U:RDoc::AnyMethod[iI" rm_r:ETI"FileUtils#rm_r;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Removes entries at the paths in the given +list+ ;TI"+(a single path or an array of paths); ;TI"Breturns +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"IMay cause a local vulnerability if not called with keyword argument ;TI"<tt>secure: true</tt>; ;TI"esee {Avoiding the TOCTTOU Vulnerability}[rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability].;T@o; ; [I"7For each file path, removes the file at that path:;T@o:RDoc::Markup::Verbatim; [ I"/FileUtils.touch(['src0.txt', 'src0.dat']) ;TI".FileUtils.rm_r(['src0.dat', 'src0.txt']) ;TI"(File.exist?('src0.txt') # => false ;TI"(File.exist?('src0.dat') # => false ;T:@format0o; ; [I"HFor each directory path, recursively removes files and directories:;T@o;; [I"tree('src1') ;TI"# => src1 ;TI"# |-- dir0 ;TI"# | |-- src0.txt ;TI"# | `-- src1.txt ;TI"# `-- dir1 ;TI"# |-- src2.txt ;TI"# `-- src3.txt ;TI"FileUtils.rm_r('src1') ;TI"$File.exist?('src1') # => false ;T; 0o; ; [I"Keyword arguments:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"G<tt>force: true</tt> - ignores raised exceptions of StandardError ;TI"and its descendants.;To;;0; [o; ; [I"B<tt>noop: true</tt> - does not remove entries; returns +nil+.;To;;0; [o; ; [I"5<tt>secure: true</tt> - removes +src+ securely; ;TI"2see details at FileUtils.remove_entry_secure.;To;;0; [o; ; [I";<tt>verbose: true</tt> - prints an equivalent command:;T@o;; [I"IFileUtils.rm_r(['src0.dat', 'src0.txt'], noop: true, verbose: true) ;TI"7FileUtils.rm_r('src1', noop: true, verbose: true) ;T; 0o; ; [I"Output:;T@o;; [I"rm -r src0.dat src0.txt ;TI"rm -r src1 ;T; 0o; ; [I"BRelated: {methods for deleting}[rdoc-ref:FileUtils@Deleting].;T: @fileI"lib/fileutils.rb;T:0@omit_headings_from_table_of_contents_below000[ I"=(list, force: nil, noop: nil, verbose: nil, secure: nil);T@[FI"FileUtils;TcRDoc::NormalModule00