delete

Dir.delete( string ) â 0 Class Public methods Deletes the named directory. Raises a subclass of SystemCallError if the directory isn't empty.

entries

Dir.entries( dirname ) â array Class Public methods Returns an array containing all of the filenames in the given directory. Will raise a SystemCallError if the named directory doesn't exist. Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"]

exist?

Dir.exist?(file_name) â true or false Class Public methods Returns true if the named file is a directory, false otherwise.

exists?

Dir.exists?(file_name) â true or false Class Public methods Returns true if the named file is a directory, false otherwise.

foreach

Dir.foreach( dirname ) {| filename | block } â nilDir.foreach( dirname ) â an_enumerator Class Public methods Calls the block once for each entry in the named directory, passing the filename of each entry as a parameter to the block. If no block is given, an enumerator is returned instead. Dir.foreach("testdir") {|x| puts "Got #{x}" } produces: Got . Got .. Got config.h Got main.rb

getwd

Dir.getwd â string Class Public methods Returns the path to the current working directory of this process as a string. Dir.chdir("/tmp") #=> 0 Dir.getwd #=> "/tmp"

glob

Dir.glob( pattern, [flags] ) â arrayDir.glob( pattern, [flags] ) {| filename | block } â nil Class Public methods Returns the filenames found by expanding pattern which is an Array of the patterns or the pattern String, either as an array or as parameters to the block. Note that this pattern is not a regexp (it's closer to a shell glob). See File::fnmatch for the meaning of the flags parameter. Note that case sensitivity depends on your system (so File::FNM_CASEFOLD is ignored),

home

Dir.home() â "/home/me"Dir.home("root") â "/root" Class Public methods Returns the home directory of the current user or the named user if given.

mkdir

Dir.mkdir( string [, integer] ) â 0 Class Public methods Makes a new directory named by string, with permissions specified by the optional parameter anInteger. The permissions may be modified by the value of File::umask, and are ignored on NT. Raises a SystemCallError if the directory cannot be created. See also the discussion of permissions in the class documentation for File. Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0

mktmpdir

mktmpdir(prefix_suffix=nil, *rest) Class Public methods ::mktmpdir creates a temporary directory. The directory is created with 0700 permission. Application should not change the permission to make the temporary directory accesible from other users. The prefix and suffix of the name of the directory is specified by the optional first argument, prefix_suffix. If it is not specified or nil, âdâ is used as the prefix and no suffix is used. If it is a string, it is used as the prefi