Ruby FileTest Functions

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

blockdev?(file_name) - Returns true if the named file is a block device.

chardev?(file_name) - Returns true if the named file is a character device.

directory?(file_name) - Returns true if the named file is a directory, false otherwise.

executable?(file_name) - Returns true if the named file is executable by the effective user id of this process.

executable_real?(file_name) - Returns true if the named file is executable by the real user id of this process.

exist?(file_name) - Return true if the named file exists.

exists?(file_name) - Return true if the named file exists.

file?(file_name) - Returns true if the named file exists and is a regular file.

grpowned?(file_name) - Returns true if the named file exists and the effective group id of the calling process is the owner of the file. Returns false on Windows.

identical?(file_1, file_2) - Returns true if the named files are identical.

owned?(file_name) - Returns true if the named file exists and the effective used id of the calling process is the owner of the file.

pipe?(file_name) - Returns true if the named file is a pipe.

readable?(file_name) - Returns true if the named file is readable by the effective user id of this process.

readable_real?(file_name) - Returns true if the named file is readable by the real user id of this process.

setgid?(file_name) - Returns true if the named file has the setgid bit set.

setuid?(file_name) - Returns true if the named file has the setuid bit set.

size?(file_name) - Returns nil if file_name doesn't exist or has zero size, the size of the file otherwise.

size(file_name) - Returns the size of file_name.

socket?(file_name) - Returns true if the named file is a socket.

sticky?(file_name) - Returns true if the named file has the sticky bit set.

symlink?(file_name) - Returns true if the named file is a symbolic link.

writable?(file_name) - Returns true if the named file is writable by the effective user id of this process.

writable_real?(file_name) - Returns true if the named file is writable by the real user id of this process.

zero?(file_name) - Returns true if the named file exists and has a zero size.