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.#{$$}"

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

chdir

chdir(dir, options = {}) Class Public methods Alias for: cd

cd

cd(dir, options = {}) Class Public methods Options: verbose Changes the current directory to the directory dir. If this method is called with block, resumes to the old working directory after the block execution finished. FileUtils.cd('/', :verbose => true) # chdir and report it FileUtils.cd('/') do # chdir [...] # do something end # return to original directory chdir

zero?

File.zero?(file_name) â true or false Instance Public methods Returns true if the named file exists and has a zero size. file_name can be an IO object.

writable_real?

File.writable_real?(file_name) â true or false Instance Public methods Returns true if the named file is writable by the real user id of this process.

writable?

File.writable?(file_name) â true or false Instance Public methods Returns true if the named file is writable by the effective user id of this process.

world_writable?

File.world_writable?(file_name) â fixnum or nil Instance Public methods If file_name is writable by others, returns an integer representing the file permission bits of file_name. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2). file_name can be an IO object. File.world_writable?("/tmp") #=> 511 m = File.world_writable?("/tmp") sprintf("%o", m) #=> "777"

world_readable?

File.world_readable?(file_name) â fixnum or nil Instance Public methods If file_name is readable by others, returns an integer representing the file permission bits of file_name. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2). file_name can be an IO object. File.world_readable?("/etc/passwd") #=> 420 m = File.world_readable?("/etc/passwd") sprintf("%o", m) #=> "644"

symlink?

File.symlink?(file_name) â true or false Instance Public methods Returns true if the named file is a symbolic link.