Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 1 Jahr, 3 Monaten
Letzter Beitrag:
vor 1 Jahr, 3 Monaten
Beteiligte Autoren:
Scott Daughtry, Fabrice Harari

Recursive Directory Scan to Populate a Table

Startbeitrag von Scott Daughtry am 22.11.2016 16:40

I'm looking for the most efficient way to populate a table (fields being filename, file extension, file size, creation date) from a directory that contains subfolders - the user would decide what file extension(s) they want added to the table.

In other languages, functions that scan a directory tree typically populate an array - WinDev appears to build a string. My first concern is the string length - one sample folder contains > 7000 potential files matching the search criteria. The second concern is how best to add only files that match the file extension criteria - is it better to scan for everything and filter out the undesirable files when adding records to the table or is it more efficient to weed out the undesirable files during the recursive scan?

Antworten:

Hi Scott

flistfile in recursive mode with the extension filter for your files is the fastest way.
I doubt that your string will be bigger than 2 GB, so you should be ok.

If you are not, you can use the alternate syntax, where a procedure is called for each file (slower)

Best regards

von Fabrice Harari - am 22.11.2016 17:29
Hi Fabrice - its great to hear from you (I still visit your web site from time to time ). I didn't know that WinDev could have a string up to 2GB in size - that is huge!

Can I pass a list of file extensions to fListFile that I want added to it's output string (e.g. *.Bmp;*.Jpg) and exclude everything else, or do I need to compare each CR delimited element for the desired file extension (which sounds like it might be less efficient or run slower)?

von Scott Daughtry - am 22.11.2016 17:33
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.