pos=

dir.pos( integer ) â integer Instance Public methods Synonym for Dir#seek, but returns the position parameter. d = Dir.new("testdir") #=> #<Dir:0x401b3c40> d.read #=> "." i = d.pos #=> 12 d.read #=> ".." d.pos = i #=> 12 d.read #=> ".."

pos

dir.pos â integer Instance Public methods Returns the current position in dir. See also Dir#seek. d = Dir.new("testdir") d.tell #=> 0 d.read #=> "." d.tell #=> 12

path

dir.path â string or nil Instance Public methods Returns the path parameter passed to dir's constructor. d = Dir.new("..") d.path #=> ".."

inspect

dir.inspect â string Instance Public methods Return a string describing this Dir object.

each

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

close

dir.close â nil Instance Public methods Closes the directory stream. Any further attempts to access dir will raise an IOError. d = Dir.new("testdir") d.close #=> nil

unlink

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

tmpdir

tmpdir() Class Public methods Returns the operating system's temporary file path.

rmdir

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

pwd

Dir.pwd â 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"