From: Ron Jeffries Date: 2002-01-12T06:44:49+09:00 Subject: Re: Dir.entries have no home On Fri, 11 Jan 2002 20:06:36 GMT, Steve Tuckner wrote: >This is a very legitimate concern. I have wanted to know which files have >changed in a particular directory since a certain date. Now with a the >standard Dir[] message, I can get a list of files in the given directory, >then I have to call File.stat for each file. On a Windows system with a lot >of files in directory (say 3000), this takes a looooooooong time. If I do a >system("dir") it is much faster but hardly and elegant solution. Another >solution would be to write a C extension to call Win32 FindFirst, and >FindNext functions and return a Filename or DirEntry object. > >Maybe the best way to approach this is to have Dir[] return a File object >that you can send a message to get the information you want without >consulting the file system. That is if the file object has been created >with meta data associated with it (ie. Mod Time, etc), then it should be >available without consulting the file system and if not the file system can >be consulted to get that information. This does bring up the problem of the >file's meta data changing without the File object knowing about it. Problem with a File object, if I understand it, is that it's open. I suspect but have not tested that FileTest may be faster for at least some methods owing to not having to open the file. On the other hand, maybe I'm just confused ... Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.