From: "Berger, Daniel" Date: 2005-06-24T06:36:50+09:00 Subject: Re: Dir[] and Windows Network Addresses > -----Original Message----- > From: Brian Takita [mailto:brian.takita@gmail.com] > Sent: Thursday, June 23, 2005 3:11 PM > To: ruby-talk ML > Subject: Dir[] and Windows Network Addresses > > > Hello, > > Is is possible to get the contents of a Windows network > directory using Dir? > > I would think it would be something like > Dir['\\\\Computer\\Dir\\*'] but nothing shows up. > > Is there a way to access the a Windows network directory > without having to call exec 'dir \\\\Computer\\Dir' and > parsing the output? Watch the single versus double quotes. However, that's not the problem anway. Specifying the root makes it fail: irb(main):019:0> Dir["*.*"] => ["AUTOEXEC.BAT", "boot.ini"] # Much snippage irb(main):016:0> Dir["C:\\*.*"] => [] However, Dir.entries should do the trick in the meantime: irb(main):017:0> Dir.entries("\\\\vadevweb\\public") => [".", "..", "Builds", "Devtools", "Projects", "vss"] Looks like a bug in Dir.glob to me. Regards, Dan PS - Find.find seems to handle UNC paths alright, too.