mkdir

mkdir(list, options = {}) Class Public methods Options: mode noop verbose Creates one or more directories. FileUtils.mkdir 'test' FileUtils.mkdir %w( tmp data ) FileUtils.mkdir 'notexist', :noop => true # Does not really create. FileUtils.mkdir 'tmp', :mode => 0700

makedirs

makedirs(list, options = {}) Class Public methods Alias for: mkdir_p

ln_sf

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

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

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

link

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

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

identical?

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

getwd

getwd() Class Public methods Alias for: pwd

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.