On Tuesday 26 July 2005 23:49, Joel VanderWerf wrote:
> Is this normal?
>
> irb(main):027:0> d = Dir.new '/'
> => #<Dir:0xb7dd5c54>
> irb(main):028:0> d.entries
> => [".", "..", "lost+found", "etc", "media", "cdrom", "var", "usr",
> "bin", "boot", "dev", "home", "lib", "mnt", "proc", "root", "sbin",
> "tmp", "sys", "srv", "opt", "initrd", ".dev", "initrd.img", "vmlinuz",
> "win", "ibm", "initrd.img.old", "vmlinuz.old"]
> irb(main):029:0> d.entries
> => []
> irb(main):030:0> RUBY_VERSION
> => "1.8.2"
> irb(main):031:0> RUBY_RELEASE_DATE
> => "2004-12-25"

Call <tt>dir.rewind</tt> before <tt>dir.entries</tt> and it
works as expected.

-- 
Stefan