copy_stream

copy_stream(src, dest) Class Public methods Copies stream src to dest. src must respond to read(n) and dest must respond to write(str).

cp

cp(src, dest, options = {}) Class Public methods Options: preserve noop verbose Copies a file content src to dest. If dest is a directory, copies src to dest/src. If src is a list of files, then dest must be a directory. FileUtils.cp 'eval.c', 'eval.c.org' FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6' FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', :verbose => true FileUtils.cp 'symlink', 'dest' # copy content, "dest" is not a symlink copy

cp_r

cp_r(src, dest, options = {}) Class Public methods Options: preserve noop verbose dereference_root remove_destination Copies src to dest. If src is a directory, this method copies all its contents recursively. If dest is a directory, copies src to dest/src. src can be a list of files. # Installing ruby library "mylib" under the site_ruby FileUtils.rm_r site_ruby + '/mylib', :force FileUtils.cp_r 'lib/', site_ruby + '/mylib' # Examples of copying several files to target directory.

getwd

getwd() Class Public methods Alias for: pwd

identical?

identical?(a, b) Class Public methods Alias for: compare_file

install

install(src, dest, options = {}) Class Public methods Options: mode preserve noop verbose If src is not same as dest, copies it and changes the permission mode to mode. If dest is a directory, destination is dest/src. This method removes destination before copy. FileUtils.install 'ruby', '/usr/local/bin/ruby', :mode => 0755, :verbose => true FileUtils.install 'lib.rb', '/usr/local/lib/ruby/site_ruby', :verbose => true

link

link(src, dest, options = {}) Class Public methods Alias for: ln

ln

ln(src, dest, options = {}) Class Public methods Options: force noop verbose ln(old, new, options = {}) Creates a hard link new which points to old. If new already exists and it is a directory, creates a link new/old. If new already exists and it is not a directory, raises Errno::EEXIST. But if :force option is set, overwrite new. FileUtils.ln 'gcc', 'cc', :verbose => true FileUtils.ln '/usr/bin/emacs21', '/usr/bin/emacs' ln(list, destdir, options = {}) Creates several hard lin

ln_s

ln_s(src, dest, options = {}) Class Public methods Options: force noop verbose ln_s(old, new, options = {}) Creates a symbolic link new which points to old. If new already exists and it is a directory, creates a symbolic link new/old. If new already exists and it is not a directory, raises Errno::EEXIST. But if :force option is set, overwrite new. FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby' FileUtils.ln_s 'verylongsourcefilename.c', 'c', :force => true ln_s(list, d

ln_sf

ln_sf(src, dest, options = {}) Class Public methods Options: noop verbose Same as #ln_s(src, dest, :force => true)