Randall,
Your test is irrelevant. You need to try with a directory with a huge number of files. Try windows\system32. Also you need to give some mask, say *p*. I haven't run this test on this directory myself (busy at the moment), but I have 6K files there. It would be preferable to have this test on a directory with more than 13K files.
>Howdy Naomi,
>
>>I modified the test program slightly to get lcMask by Inputbox and for E3 I have 11 wrong files:
>>
>>W-ER4026D.JPG
>>W-ER4036D.JPG
>>W-ER4056D.JPG
>>W-ER4066D.JPG
>>W-TB2211D.JPG
>>W-TB1022D.JPG
>>W-NK646CIT.JPG
>>W-TB2209D.JPG
>>W-TB2408D.JPG
>>W-TB2289A.JPG
>>W-TB2448D.JPG
>>
>>I think I can stop testing for now.
>
>
>I tried the following code (slightly modified) with no problems with VFP 9 SP1:
>
>
>
>#define crlf CHR(13) + CHR(10)
>
>= MESSAGEBOX(DIRECTORY("c:\windows"))
>
>m.ltTime = DATETIME()
>
>_cliptext = ""
>
>CREATE CURSOR crsTest (FieldName C(50))
>
>m.lcFileName = SYS(2000,'c:\windows\*.exe')
>
>DO WHILE NOT EMPTY(m.lcFileName)
>
> WAIT WINDOW NOWAIT m.lcFileName
>
> UPPER(m.lcFileName)
> _cliptext = _cliptext + m.lcFileName + CRLF
> INSERT INTO crsTest VALUES (m.lcFileName)
>
>*!* NOTE! Notice the 1 here..for get the "next" record that matches.
>
> m.lcFileName = SYS(2000,'c:\windows\*.exe', 1)
>
>ENDDO
>
>= MESSAGEBOX("Execution Time = " + STR((DATETIME() - m.ltTime)))
>= MESSAGEBOX("Record Count = " + STR(RECCOUNT('crsTest')))
>
>
>
>>What do you think should I do to fix the situation?
>
>Try running the above code and tell me if it works, please.
>
>>One of the ideas is to create a list of all jpg and tif files in the directory at night
>>and use this list from the application. We need to have a directory monitor for this approach
>>since new files may be added during the day... It's achievable in VFP9 and documented in solution/samples...
>
>I guess you could do a cron-type thing, getting all of the new files for today or
>something. (Shrug.)
>
>Regards,
>
>Randall
If it's not broken, fix it until it is.
My Blog