From: Massimiliano Mirra Date: 2002-01-12T10:12:49+09:00 Subject: Re: Dir.entries have no home On Sat, Jan 12, 2002 at 04:44:42AM +0900, Ron Jeffries wrote: > Thanks David and Massimilano for your interesting and helpful replies. > Looks like I should get 1.7. Is it pretty stable as such things go? I don't know, but the snippet I reported works under 1.6.6, and the block version of chdir should be easy to implement under 1.6.x if you prefer to wait for the next stable release. > Where I was really going, though, was to a different issue. > I'm suggesting that the objects involved in the Dir.entries, FileTest, > and File families aren't quite right. Think of it this way: FWIW: yes, I understood what you meant. I think you're not really after a ``File'' object (with opening, closing, writing etc.) but rather a ``FileDescription'' object. This would still raise the synchronization issues someone mentioned, but not differently than the (so to speak) low-level manual path-building counterparts. So good news and no bad news. It would be great if Dir.entries returned some collection of objects, each of them with data like [absolute_path, atime, ctime, permissions] and a method like ``refresh'' or ``ping'': if file.ping # file still exists and specs get updated `command #{file.abspath}` else # ping returned false puts "File #{file.name} was moved or deleted." end Massimiliano