Skip to content
instance method

Dir#each_child

() { (::String) -> void } -> self
() -> ::Enumerator[::String, self]
each_child {|entry_name| ... } → self

Calls the block with each entry name in self except '.' and '..':

Example
dir = Dir.new('/example')
dir.each_child {|entry_name| p entry_name }

Output:

Example
"config.h"
"lib"
"main.rb"

If no block is given, returns an enumerator.

See also .each_child #each #fileno #close also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0