Simple newbie file question


(Berger, Daniel) #1

iteratively

Dir.foreach(“someDir”){ |entry| puts entry }

lvalue

dirs = []
dirs = Dir.entries(“someDir”)

Regards,

Dan

···

-----Original Message-----
From: news no gname [mailto:briqueabraque@yahoo.com]
Sent: Monday, June 24, 2002 9:41 AM
To: ruby-talk@ruby-lang.org
Subject: Simple newbie file question

Hi,

How can I get a list of the files in a directory in Ruby?

Thanks,
Mauricio