open

Dir.open( string ) â aDirDir.open( string ) {| aDir | block } â anObject Class Public methods With no block, open is a synonym for Dir::new. If a block is present, it is passed aDir as a parameter. The directory is closed at the end of the block, and Dir::open returns the value of the block.

new

Dir.new( string ) â aDir Class Public methods Returns a new directory object for the named directory.

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

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

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.

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),

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"

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

exists?

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

exist?

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