From: Phillip Gawlowski Date: 2011-04-07T23:28:36+09:00 Subject: Re: Windows directories not recognized by ruby? On Thu, Apr 7, 2011 at 4:03 PM, Kalman H. wrote: > What's wrong with this code? > > C:\>mkdir test_ruby > > C:\>irb > irb(main):001:0> File.directory? "c:" > => true > irb(main):002:0> File.directory? "c:\test_ruby" > => false > irb(main):003:0> > The \ is an escape character, so you are actually checking for "c: est_ruby" (\t is is the escape sequence for a tab character) Either try File.directory? "c:\\test_ruby" or File.directory? "c:/test_ruby" Windows NT *at least* since Vista, but probably XP already, and maybe even the original NT 3.51, support the forward slash in the command line. -- 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.