D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
FileUtils
/
Filename :
mv-c.ri
back
Copy
U:RDoc::AnyMethod[iI"mv:ETI"FileUtils::mv;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Moves entries.;To:RDoc::Markup::BlankLine o; ; [I":Arguments +src+ (a single path or an array of paths) ;TI" and +dest+ (a single path) ;TI"Kshould be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].;T@o; ; [I"8If +src+ and +dest+ are on different file systems, ;TI"&first copies, then removes +src+.;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"SIf +src+ is the path to a single file or directory and +dest+ does not exist, ;TI"moves +src+ to +dest+:;T@o:RDoc::Markup::Verbatim; [I"tree('src0') ;TI"# => src0 ;TI"# |-- src0.txt ;TI"# `-- src1.txt ;TI"%File.exist?('dest0') # => false ;TI"#FileUtils.mv('src0', 'dest0') ;TI"%File.exist?('src0') # => false ;TI"tree('dest0') ;TI"# => dest0 ;TI"# |-- src0.txt ;TI"# `-- src1.txt ;T:@format0o; ; [I"<If +src+ is an array of paths to files and directories ;TI",and +dest+ is the path to a directory, ;TI"2copies from each path in the array to +dest+:;T@o;; [I"&File.file?('src1.txt') # => true ;TI"tree('src1') ;TI"# => src1 ;TI"# |-- src.dat ;TI"# `-- src.txt ;TI"&Dir.empty?('dest1') # => true ;TI"1FileUtils.mv(['src1.txt', 'src1'], 'dest1') ;TI"tree('dest1') ;TI"# => dest1 ;TI"# |-- src1 ;TI"# | |-- src.dat ;TI"# | `-- src.txt ;TI"# `-- src1.txt ;T; 0o; ; [I"Keyword arguments:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"@<tt>force: true</tt> - if the move includes removing +src+ ;TI"C(that is, if +src+ and +dest+ are on different file systems), ;TI"Dignores raised exceptions of StandardError and its descendants.;To;;0; [o; ; [I"/<tt>noop: true</tt> - does not move files.;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">FileUtils.mv('src0', 'dest0', noop: true, verbose: true) ;TI"LFileUtils.mv(['src1.txt', 'src1'], 'dest1', noop: true, verbose: true) ;T; 0o; ; [I"Output:;T@o;; [I"mv src0 dest0 ;TI"mv src1.txt src1 dest1;T; 0: @fileI"lib/fileutils.rb;T:0@omit_headings_from_table_of_contents_below000[[I" move;To;; [ ;@i;0I"B(src, dest, force: nil, noop: nil, verbose: nil, secure: nil);T@iFI"FileUtils;TcRDoc::NormalModule00