chmod

chmod(mode, list, options = {}) Class Public methods Options: noop verbose Changes permission bits on the named files (in list) to the bit pattern represented by mode. mode is the symbolic and absolute mode can be used. Absolute mode is FileUtils.chmod 0755, 'somecommand' FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb) FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true Symbolic mode is FileUtils.chmod "u=wrx,go=rx", 'somecommand' FileUtils.chmod "u=wr,go=rr", %w(my.r

chmod_R

chmod_R(mode, list, options = {}) Class Public methods Options: noop verbose force Changes permission bits on the named files (in list) to the bit pattern represented by mode. FileUtils.chmod_R 0700, "/tmp/app.#{$$}" FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"

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

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

cmp

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

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

compare_stream

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

copy

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

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