Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory Structure

Status
Not open for further replies.

budman48

MIS
Dec 20, 2002
23
0
0
US
How do I list the directory tree to use in a copy procedure.
I need it to list both files and folders and what is in folders to use when copy files and folders.
 
You can do this with ADIR(). Pass "D" as the third argument, and you'll get an array filled with the file and sub-directory names. Loop through this array, printing the names with "?". For the directories, call ADIR() recursively.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
You could use SCRIPTING host object to copy whole directory tree at once.
Other way is to create a recursing function based on ADIR() (as Mike suggested) to get whole tree. Keep in mind that is you use version smaller than VFP9 you could have problems if you have more than 13K files in the folder.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
Microsoft MVP VFP
 
If you want the results in a table try
faq184-6591


David W. Grewe Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top