Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Number of Files NOT using ADIR()
Message
 
 
To
28/01/2010 12:02:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01446331
Message ID:
01446354
Views:
67
>>>>I need to retrieve the number of files in a folder (possibly a mapped network drive) without using ADIR(). This folder could potentially contain over 10,000 files. Any ideas?
>>>
>>>Why ADIR() is out?
>>
>>I have found ADIR() unreliable on directories with large quantities of files.
>
>That was before VFP9. Anyway, you can use sys(2000) in a loop, but it's slooow
>X=0
>cMask='c:\temp\*.*'
>If !empty(Sys(2000,cMask))
>   x = x + 1 
>   Do While !empty(Sys(2000,cMask,1))
>      x = x + 1 
>   Enddo 
>Endif 
>Wait x Window    
>
Why not using FileSystemObject.GetFolder(lcDir).Files.Count ? -- I write the idea from memory
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform