Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NUMBER OF FILES IN A DIRECTORY
Message
 
 
To
10/03/2000 11:27:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00344120
Message ID:
00344599
Views:
39
Cetin,

It's not practical, and almost impossible, to create a directory tree so deep that VFP can't recurse the whole tree. The maximum length of a path in Win32 is 260 characters. So if a single letter is used for each level e.g \a\b\c\d\e\f\a\a you could create 130 levels which would be 2 levels deeper that the recurrsion limit of VFP. The probability of such a real world directory structure is so low I think it can be safely ignored.

>Think of time needed to collect all that info. Recursion is one of the answers but it might be the trap too if not done correctly. If directory depth goes over allowed nested calls than you're likely to get an error with recursion. Better instead of checking all at once, look when needed. Also with FSO be carefull it accesses to special folders too. One of these special folders is important that you shouldn't further attempt to get subfolders ("System Volume Information"). What that directory is a mystery to me. For FSO reference and a sample code search jscript5.chm on your MSDN. Also do a search for FSO and you'd find some code using it the way you want (months ago so Jan 1,1999-Jul 1,1999 is a near bet:).
>Cetin
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform