From: Hayato Iriumi Date: 2007-08-24T01:33:44+09:00 Subject: Re: Get Date Modified value for a directory (folder) Hello, After I read your reply, I gave it another try. It's working now! I don't understand why it wasn't working last time, but now it's all good. I might have had some wrong code? Anyway, thanks for taking your time to try it out. Pe単a, Botp wrote: > On Behalf Of Hayato Iriumi: > # I was trying to get modified date/time for a remote directory and the > # way you showed me worked only when I mapped the drive, so it's all OK, > # but I just wanted to let the community know that it doesn't > # seem to work if you specify the path like... > # > # puts File.stat('\\\\remoteMachineName\\Test\\Dir1') > # > # When I do it, I get Errno::ENOENT: No such file or directory - > # > # Again, when I map the network folder, it works OK. > > Hi Iriumi, > > it works here, > > irb(main):054:0> puts `dir \\\\bg-mis-pbot\\test\\test.txt` > Volume in drive \\bg-mis-pbot\test is hd > Volume Serial Number is 7CD8-B514 > > Directory of \\bg-mis-pbot\test > > 08/23/2007 08:53 AM 0 test.txt > 1 File(s) 0 bytes > 0 Dir(s) 1,899,081,728 bytes free > => nil > irb(main):055:0> puts File.stat("\\\\bg-mis-pbot\\test\\test.txt") > # > => nil > irb(main):056:0> p File.stat("\\\\bg-mis-pbot\\test\\test.txt") > # rdev=0x2, size=0, blksize=nil, blocks=nil, atime=Thu Aug 23 08:53:35 > +0800 2007, mtime=Thu Aug 23 08:53:35 +0800 2007, ctime=Thu Aug 23 > 08:53:35 +0800 2007> > => nil > irb(main):057:0> > irb(main):058:0> puts `ver` > Microsoft Windows XP [Version 5.1.2600] > => nil > irb(main):066:0> p File.mtime('\\\\bg-mis-pbot\\test\\test.txt') > Thu Aug 23 08:53:35 +0800 2007 > => nil > > kind regards -botp -- Posted via http://www.ruby-forum.com/.