General Question

Espin01's avatar

Working with files in Ruby...

Asked by Espin01 (32points) February 26th, 2008

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

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

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther