Ruby FileUtils Functions

EditRocket provides the following information on FileUtils functions in the Ruby source code builder.

cd(dir, options = {}) - "Options: verbose"

chdir(dir, options = {}) - "Alias for #cd"

chmod(mode, list, options = {}) - "Options: noop verbose"

chmod_R(mode, list, options = {}) - "Options: noop verbose force"

chown(user, group, list, options = {}) - "Options: noop verbose"

chown_R(user, group, list, options = {}) - "Options: noop verbose force"

cmp(a, b) - "Alias for #compare_file"

compare_file(a, b) - Returns true if the contents of a file A and a file B are identical.

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

copy(src, dest, options = {}) - "Alias for #cp"

copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false) - 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)

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

copy_stream(src, dest) - "Copies stream src to dest. src must respond to #read(n) and dest must respond to #write(str)."

cp(src, dest, options = {}) - "Options: preserve noop verbose"

cp_r(src, dest, options = {}) - "Options: preserve noop verbose dereference_root remove_destination"

fu_have_symlink?( -

fu_world_writable?(st) -

getwd() - "Alias for #pwd"

identical?(a, b) - "Alias for #compare_file"

install(src, dest, options = {}) - "Options: mode preserve noop verbose"

link(src, dest, options = {}) - "Alias for #ln"

ln(src, dest, options = {}) - "Options: force noop verbose"

ln_s(src, dest, options = {}) - "Options: force noop verbose"

ln_sf(src, dest, options = {}) - "Options: noop verbose"

makedirs(list, options = {}) - "Alias for #mkdir_p"

mkdir(list, options = {}) - "Options: mode noop verbose"

mkdir_p(list, options = {}) - "Options: mode noop verbose"

mkpath(list, options = {}) - "Alias for #mkdir_p"

move(src, dest, options = {}) - "Alias for #mv"

mv(src, dest, options = {}) - "Options: force noop verbose"

pwd() - "Options: (none)"

remove(list, options = {}) - "Alias for #rm"

remove_dir(path, force = false) - Removes a directory dir and its contents recursively. This method ignores StandardError if force is true.

remove_entry(path, force = false) - This method removes a file system entry path. path might be a regular file, a directory, or something. If path is a directory, remove it recursively.

remove_entry_secure(path, force = false) - "This method removes a file system entry path. path shall be a regular file, a directory, or something. If path is a directory, remove it recursively. This method is required to avoid TOCTTOU (time-of-check-to-time-of-use) local security vulnerability of #rm_r. #rm_r causes security hole when:"

remove_file(path, force = false) - Removes a file path. This method ignores StandardError if force is true.

rm(list, options = {}) - "Options: force noop verbose"

rm_f(list, options = {}) - "Options: noop verbose"

rm_r(list, options = {}) - "Options: force noop verbose secure"

rm_rf(list, options = {}) - "Options: noop verbose secure"

rmdir(list, options = {}) - "Options: noop, verbose"

rmtree(list, options = {}) - "Alias for #rm_rf"

safe_unlink(list, options = {}) - "Alias for #rm_f"

symlink(src, dest, options = {}) - "Alias for #ln_s"

touch(list, options = {}) - "Options: noop verbose"

uptodate?(new, old_list, options = nil) - "Options: (none)"