You can interrogate "files" as to what it is, and / or what methods it accepts:
files.class
files.methods.sort
Then you can check Ruby's documentation (or remember off the top of
your head ) what other method would be appropriate (if any).
···
On Thu, Dec 23, 2010 at 2:35 PM, Peter Bailey <pbailey@bna.com> wrote:
Hello,
Can someone please tell me how to get a count for the number of files in
a directory?
Example:
files = Dir.glob("*.pdf")
puts files.count ??
That doesn't work, but, I'd love to know what would work.
--
Phillip Gawlowski
Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.