123456789_123456789_123456789_123456789_123456789_

Module: FileTest

Relationships & Source Files
Defined in: file.c,
dir.c

Overview

FileTest implements file test operations similar to those used in ::File::Stat. It exists as a standalone module, and its methods are also insinuated into the ::File class. (Note that this is not done by inclusion: the interpreter cheats).

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#directory?(dirpath) ⇒ Boolean (readonly)

Alias for File.directory?. Returns whether dirpath is a directory in the underlying file system:

Dir.exist?('/example')         # => true
Dir.exist?('/nosuch')          # => false
Dir.exist?('/example/main.rb') # => false

Same as File.directory?.

Instance Method Details

#blockdev?(filepath) ⇒ Boolean

Alias for File.blockdev?.

#chardev?(filepath) ⇒ Boolean

Alias for File.chardev?.

#empty?(file_name) ⇒ Boolean

Alias for File.empty?. Returns true if the named file exists and has a zero size.

file_name can be an ::IO object.

#executable?(file_name) ⇒ Boolean

Alias for File.executable?.

#executable_real?(file_name) ⇒ Boolean

#exist?(file_name) ⇒ Boolean

Alias for File.exist?.

#file?(file) ⇒ Boolean

Alias for File.file?.

#grpowned?(file_name) ⇒ Boolean

Alias for File.grpowned?.

#identical?(file_1, file_2) ⇒ Boolean

Alias for File.identical?.

#owned?(file_name) ⇒ Boolean

Alias for File.owned?.

#pipe?(filepath) ⇒ Boolean

Alias for File.pipe?.

#readable?(file_name) ⇒ Boolean

Alias for File.readable?.

#readable_real?(file_name) ⇒ Boolean

Alias for File.readable_real?.

#setgid?(file_name) ⇒ Boolean

Alias for File.setgid?.

#setuid?(file_name) ⇒ Boolean

Alias for File.setuid?.

#size(file_name) ⇒ Integer

Alias for File.size.

#size?(file_name) ⇒ Integer?

Alias for File.size?.

#socket?(filepath) ⇒ Boolean

Alias for File.socket?.

#sticky?(file_name) ⇒ Boolean

Alias for File.sticky?.

#symlink?(filepath) ⇒ Boolean

Alias for File.symlink?.

#world_readable?(file_name) ⇒ Integer?

#world_writable?(file_name) ⇒ Integer?

#writable?(file_name) ⇒ Boolean

Alias for File.writable?.

#writable_real?(file_name) ⇒ Boolean

Alias for File.writable_real?.

#zero?(file_name) ⇒ Boolean

Alias for File.zero?.