Method: Dir.exist?

Defined in:
dir.c

.exist?(dirpath) ⇒ Boolean

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

Returns:

  • (Boolean)


3712
3713
3714
3715
# File 'dir.c', line 3712

VALUE
rb_file_directory_p(void)
{
}