Running every file

Hi,

I need to open every file in the folder matching the same pattern...

basically,

open every file matching "report" in folder

Thanks!

···

--
Posted via http://www.ruby-forum.com/.

**and I need to return the filename to a variable 'filename'

···

--
Posted via http://www.ruby-forum.com/.

Try Dir.glob(pattern), as it returns an array with all of the files.

files = Dir.glob("*report*")

Hope that helps,

Michael Gorsuch
http://www.styledbits.com

···

On Thu, Jul 3, 2008 at 7:41 PM, Justin To <tekmc@hotmail.com> wrote:

**and I need to return the filename to a variable 'filename'
--
Posted via http://www.ruby-forum.com/\.