On Thu, Oct 25, 2007 at 04:07:10AM +0900, Wayne Magor wrote:
> Tim McIntyre wrote:
> > files = Dir.glob("img/**/*.jpg")
> 
> Why doesn't that seem to work for me on Windows?  Is there something 
> different about it on Windows than on Linux?
> 
> ruby -e 'puts Dir.glob("*.txt")'      # Works for all .txt files in cur 
> dir
> ruby -e 'puts Dir.glob("/**/*.txt")'  # Prints nothing
> ruby -e 'puts Dir.glob("**/*.txt")'   # Works if done from subdir, not 
> from C:\
> 
> Is there something different about being at the top-level directory on 
> Windows?  It's unexpected behavior for me.  Why does it operate like 
> that?

I don't currently have an MS Windows machine with Ruby installed here, so
I can't check this -- but does it perhaps have something to do with
Microsoft's odd ideas about directory path separators?  Perhaps it would
work like this on MS Windows and/or DOS:

    files = Dir.glob("img\\**\\*.jpg")

Someone correct me if I'm wrong.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
Ben Franklin: "As we enjoy great Advantages from the Inventions of others
we should be glad of an Opportunity to serve others by any Invention of
ours, and this we should do freely and generously."