On Monday 20 July 2009 03:05:18 pm Mmcolli00 Mom wrote:
> Why is it that there are '.' and '..' in my output?

Those are hidden directories on Unix, pointing to the current and parent 
directory. I'm not sure why they're on Windows, too...

> I want to create a
> list of all the files in this directory without showing the . and .. at
> the top of the list. What do you do for this?

I'd do this:

#snippet
myfolder = "c:/myfolder"

Dir.entries(myfolder).each do |filename|
  puts filename unless filename =~ /^\.\.?$/
end
#end snippet

You could do it other ways, too. I'm not sure which is faster.

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