Alex wrote:
> On Mon, Jul 20, 2009 at 4:19 PM, David Masover<ninja / slaphack.com> 
> wrote:
>> I'd do this:I
>>
>> Of course, this might still not do what you want -- it's going to include
>> folders, too. If you just want files, you could do something like this:
>>
>> Dir.entries(myfolder).each do |filename|
>> puts filename if File.file?(filename)
>> end
>>
>>
> 
> 
> I would just do something like this:
> 
> Dir.entries(dir).reject{|entry| entry =~ /^\.{1,2}$/}
> 


On unix, Dir.glob doesn't return hidden files(like Dir.entries does):


dirname = "whatever"

Dir.glob("#{dirname}/*").each do |fname|
  puts fname
end
-- 
Posted via http://www.ruby-forum.com/.