I am hoping and expecting that there is a faster way to get a list of around 24,000 files in a directory than ADIR() - I'm having trouble finding a Shell32 equivalent in the hopes of finding something faster.
I don't think you'll get good performance out of any folder that has that many files in it - the issue is Windows itself being slow to retrieve the directory listing if I remember.
There's a FindFirstFile() API that you can use to iterate through files - it doesn't retrieve it just gives you one file at a time so you can pull out what you need so you don't automatically create a huge array of all the files, but you only take what you need. But honestly I don't think that's the problem - the directory itself the slowness. For example, Explorer slows to a crawl if you access a folder with that many files.
Also you can try .NET... System.IO.Path.Directory.GetFiles() with wwDotnetBridge. But that too will give you an in memory list plus COM overhead most likely.
+++ Rick ---
Check out SYS(2000)
Check out SYS(2000)
Ah yes, that's right - this is FoxPro's wrapper around the FindFirstFile()
API.
+++ Rick ---
Thanks for the feedback.
I did find that ADIREx from vfp2c32.fll is twice as fast as ADIR() on the live server - but I'm hoping to convince the customer to pre-populate and update a DBF every few hours (or run an out-of-process exe upon login).
https://github.com/ChristianEhlscheid/vfp2c32
All the other options I tried were slower.