Method: Dir#children

Defined in:
dir.c

#childrenArray

Returns an array containing all of the filenames except for “.” and “..” in this directory.

d = Dir.new("testdir")
d.children   #=> ["config.h", "main.rb"]

Returns:

[View source]

3119
3120
3121
3122
3123
3124
3125
# File 'dir.c', line 3119

static VALUE
dir_collect_children(VALUE dir)
{
    VALUE ary = rb_ary_new();
    dir_each_entry(dir, rb_ary_push, ary, TRUE);
    return ary;
}