Method: Dir.each_child

Defined in:
dir.c

.each_child(dirpath) {|entry_name| ... } ⇒ nil .each_child(dirpath, encoding: 'UTF-8') {|entry_name| ... } ⇒ nil

Like Dir.foreach, except that entries '.' and '..' are not included.

Overloads:

  • .each_child(dirpath) {|entry_name| ... } ⇒ nil

    Yields:

    • (entry_name)

    Returns:

    • (nil)
  • .each_child(dirpath, encoding: 'UTF-8') {|entry_name| ... } ⇒ nil

    Yields:

    • (entry_name)

    Returns:

    • (nil)


3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
# File 'dir.c', line 3521

static VALUE
dir_s_each_child(int argc, VALUE *argv, VALUE io)
{
    VALUE dir;

    RETURN_ENUMERATOR(io, argc, argv);
    dir = dir_open_dir(argc, argv);
    rb_ensure(dir_each_child, dir, dir_close, dir);
    return Qnil;
}