static public Method

Dir.entries(p1)

Dir.entries( dirname )  array

Returns an array containing all of the filenames in the given directory. Will raise a SystemCallError if the named directory doesn’t exist.

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

Source Code

/*
*  call-seq:
*     Dir.entries( dirname ) => array
*
*  Returns an array containing all of the filenames in the given
*  directory. Will raise a <code>SystemCallError</code> if the named
*  directory doesn't exist.
*
*     Dir.entries("testdir")   #=> [".", "..", "config.h", "main.rb"]
*
*/
static VALUE
dir_entries(io, dirname)
   VALUE io, dirname;
{
   VALUE dir;

   dir = dir_open_dir(dirname);
   return rb_ensure(rb_Array, dir, dir_close, dir);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.