[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Running every file

Justin To

7/3/2008 11:37:00 PM

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-....

2 Answers

Justin To

7/3/2008 11:41:00 PM

0

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

Michael Gorsuch

7/3/2008 11:59:00 PM

0

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.styl...

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-....
>