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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get directory information ? 1

Status
Not open for further replies.

Brezhnev

Programmer
Sep 25, 2002
53
0
0
CA
Hi all1
I need to get number of files from a given directory and also names of those files. Is there any function in FoxPro to do that ? Or do I need to use some api ?
I experimented with list files /display files but still don't get eno info.
 
As long as you know which directory you are looking at, you can use something like:
Code:
 mcDir = "C:\Temp"
 mnFileCount = ADIR(aryFiles, mcDir + "\*.DBF")
 ? "Number of Files Found: " + STR(mnFileCount)

Look up ADIR() in Foxpro's Help to get more information.

Good Luck,
JRB-Bldr
 
Just remember that until 9.0, you are limited to 13,000 files in a directory using ADIR() - 5 * 13,000 = 65,000 elements in an array.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top