Lewis_P@cc.curtin.edu.au (Peter Lewis) (12/21/90)
Hi All, Does anyone know why PBGetFInfo with a file index that is greater than the number of files in the directory takes a huge amount of time to return? (On a Plus with the cache disabled, it can take well over a second! Turning on the cache helps, but it still takes a long time). This wouldnt be so bad, but what I want to do requires that I call PBGetFInfo in this way many times (several hundred), so what should take a couple seconds takes over a minute. Has anyone else come across this? I've tried it on a vanila system (6.0.2), so it isnt any nasty inits. (I don't think I have lost my mind yet, but I may in the near future :-). Alternatively, is there anyway to determine the number of files in a folder? (I know there is a way of determining the number of files&folders in a folder, but I need to know how many files there are - It might actually be quicker to use GetCatInfo, and ignore folders and do the indexing myself, but this would be VERY messy). TIA for any info, & Merry Christmas, Peter. -- Disclaimer:Curtin & I have an agreement:Neither of us listen to either of us. *-------+---------+---------+---------+---------+---------+---------+-------* Internet: Lewis_P@cc.curtin.edu.au I Peter Lewis ACSnet: Lewis_P@cc.cut.oz.au I NCRPDA, Curtin University Bitnet: Lewis_P%cc.curtin.edu.au@cunyvm.bitnet I GPO Box U1987 UUCP: uunet!munnari.oz!cc.curtin.edu.au!Lewis_P I Perth, WA, 6001, AUSTRALIA Hack: ResEdit ResEdit 2.0b2, change CODE=5, 00091C: 4EBA 02A4 to 4E71 4E71
daven@svc.portal.com (12/22/90)
In article <5184.2771e29c@cc.curtin.edu.au> Lewis_P@cc.curtin.edu.au (Peter Lewis) writes: >Hi All, > Does anyone know why PBGetFInfo with a file index that is greater than >the number of files in the directory takes a huge amount of time to return? >(On a Plus with the cache disabled, it can take well over a second! >Turning on the cache helps, but it still takes a long time). This wouldnt >be so bad, but what I want to do requires that I call PBGetFInfo in this >way many times (several hundred), so what should take a couple seconds >takes over a minute. Has anyone else come across this? I've tried it on a >vanila system (6.0.2), so it isnt any nasty inits. (I don't think I have >lost my mind yet, but I may in the near future :-). Well, as they say: "If it hurts, don't do it." > Alternatively, is there anyway to determine the number of files in a >folder? (I know there is a way of determining the number of files&folders >in a folder, but I need to know how many files there are - It might >actually be quicker to use GetCatInfo, and ignore folders and do the >indexing myself, but this would be VERY messy). You'd be better off in the long run using GetCatInfo, and stepping over folders. One thing to beware of... if your code is examining a directory that is on a shared volume, then there's the very real possibility of the count of files changing while you're indexing through the directory. All sorts of wonderfully strange things can happen if files appear and disappear while you're indexing along. It can cause you to skip files, or see the same file more than once. I'd love to hear what sort of fixes people have tried for this. I know of one that Disinfectant uses which probably works in most cases. -- ------------------------------------------------------------------------------- Dave Newman | daven@svc.portal.com | AppleLink: D0025 Sofware Ventures Corp. | AOL: MicroPhone | CIS: 76004,2161 Berkeley, CA 94705 | WELL: tinman@well.sf.ca.us | (415) 644-3232