Looking for files... really slow

We noticed during our development that looking for a file in RB/XOJO is unbearably slow. The process I’m talking about is using the folderitem.count in a for … next to look for matching files. This is really apparent when looking for files on a network.

It is so slow, we have resorted to using a shell command on the Mac and Windows to get a list of returned filenames and then navigating through them. This is really fast except for one caveat. Some of our users have network policies in place that restrict shell commands on some or all workstations.

FYI - Our applications allow the user to create individual client files so very often they have hundreds of files, and each data file can have as many as 10 related prior year files, so it is not uncommon for them to have 500 or more files in a folder. Try navigating through them on a network and it will put you to sleep.

Is there some other option for this or has someone found another way to speed this process up?

In this thread there are some hints of what to do when going through a lot of folderitems in a loop.

https://forum.xojo.com/13879-fastest-way-to-get-folderitem-names-into-array

http://documentation.xojo.com/index.php/FolderItem.Count

[quote]Avoid calling this function several times as it is costly in processing time.
Especially, avoid calling it repeatedly in a loop. Instead, get its value once and store it in a variable for further use.[/quote]

Torsten - Thanks for the link, excellent information, especially since we use MBS already. Looks like the answer I was looking for.

Tim - Only called once.

Switched over to FileListMBS and as usual, I’m not disappointed. Works great!

Also take a look at https://www.boxedbyte.com/xippet-191