Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subdirectory listings
Message
From
23/10/2000 08:33:26
Peter Garneau
Statistics Canada
Ontario, Canada
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00432711
Message ID:
00432795
Views:
27
Thanks a million.

>>I am trying to find a way to programatically identify all the subdirectories in a directory. For example, given the directory c:\my documents, I would like to be able create an array of all it's subdirectories.
>>
>
>The Scripting.FileSystemObject can create a collection of subfolders of a given folder.
>
>
oFSO=CREATEOBJ('Scripting.FileSystemObject')
>oFolder = oFSO.GetFolder('c:\my documents')
>FOR EACH oSubFolder IN oFolder.SubFolders
>   ? oSubFolder.Path
>ENDFOR
>
>You can do a similar type of operation using ADIR() writing a bit more code. You can work out the details for yourself of populating an array if you need it. Dave Frankenbach and I have posted several threads about the recursing of a directory tree in the past; you can dig them out if you like.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform