class

Dir

Inherits Iterable < Enumerable < Reference < Object

Objects of class Dir are directory streams representing directories in the underlying file system. They provide a variety of ways to list directories and their contents.

The directory used in these examples contains the two regular files (config.h and main.rb), the parent directory (..), and the directory itself (.).

See also: File.

Constructors

new(path : Pathname)
Source

Class methods

cd(path : Pathname)
Source
cd(path : Pathname, &)
Source
entries(path : Pathname)
Source
exists?(path : Pathname)
Source
foreach(path : Pathname, &)
Source
mkdir(path : Pathname, mode = 511)
Source
mkdir_p(path : Pathname, mode = 511)
Source
open(path : Pathname)
Source
open(path : Pathname, &)
Source
rmdir(path : Pathname)
Source