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

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).

copy_file

copy_file(src, dest, preserve = false, dereference = true) Class Public methods Copies file contents of src to dest. Both of src and dest must be a path name.

copy_entry

copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false) Class Public methods Copies a file system entry src to dest. If src is a directory, this method copies its contents recursively. This method preserves file types, c.f. symlink, directory⦠(FIFO, device files and etc. are not supported yet) Both of src and dest must be a path name. src must exist, dest must not exist. If preserve is true, this method preserves owner, group, and modified ti

copy

copy(src, dest, options = {}) Class Public methods Alias for: cp

compare_stream

compare_stream(a, b) Class Public methods Returns true if the contents of a stream a and b are identical.

compare_file

compare_file(a, b) Class Public methods Returns true if the contents of a file A and a file B are identical. FileUtils.compare_file('somefile', 'somefile') #=> true FileUtils.compare_file('/bin/cp', '/bin/mv') #=> maybe false identical? cmp

cmp

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

chown_R

chown_R(user, group, list, options = {}) Class Public methods Options: noop verbose force Changes owner and group on the named files (in list) to the user user and the group group recursively. user and group may be an ID (Integer/String) or a name (String). If user or group is nil, this method does not change the attribute. FileUtils.chown_R 'www', 'www', '/var/www/htdocs' FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', :verbose => true

chown

chown(user, group, list, options = {}) Class Public methods Options: noop verbose Changes owner and group on the named files (in list) to the user user and the group group. user and group may be an ID (Integer/String) or a name (String). If user or group is nil, this method does not change the attribute. FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby' FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), :verbose => true