Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adir() vs FileSystemObject

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I have been using FileSystemObject to populate a cursor with file names from a network folder. This cursor is then displayed in a grid with a matching user editable description field from a table. The structure on the drive is a main folder with subfolders for each client. Within each client folder are files for each client. I only populate the cursor when a user has navigated to the proper client and requested a list of the files. This has worked well until they had a client with about 100 files and the system takes 10-20 seconds to retrieve the file list. Without doing a lot of testing, does anyone know if using adir() to perform this function would be any faster?

Thanks,
Auguy
 
ilyad, thanks for the answer and the links. I will look at the recursive directory processing for more (and probably better) ideas.

Auguy
 
Auguy,

Not only is ADIR() faster, but it's probably safer as well. That's because the FileSystemObject is part of Windows Scripting Host, and it's always possible that someone will disable it on a particular PC. ADIR() on the other hand relies on direct API calls, which you can assume will always be available.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike. That confirms some of my further investigation into the FileSystemObject. Also found that there are several versions that could potentially cause problems.

Auguy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top