Question

Espin01's avatar

Working with files in Ruby...

Asked by Espin01 (27 points) | asked February 26th, 2008 | 2 responses | “Great Question” (1 points) | Flag as…

Ok, I have ruby and I would like it to store the names of all of the jpeg files in the folder the program is located in and preform a certain action on each file. I am guessing I need to put all the names into an array, but that is about it.

Observing members: 0 Composing members: 0

Answers

paulc's avatar

Dir.glob and Dir.each will help you out. I suggest glob so you can just match to a pattern.

Answer this question

Login

or

Join

to answer.
Your answer will be saved while you login or join.