Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Number of Files NOT using ADIR()
Message
From
28/01/2010 12:46:22
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01446331
Message ID:
01446362
Views:
57
>>>>>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

Or Sedna, if you have installed it
My = newobject('My', 'my.vcx')
xx=my.COMPUTER.filesystem.GetDirectoryInfo('c:\temp\')
lnFiles=xx.Files.Count
Previous
Reply
Map
View

Click here to load this message in the networking platform