[ACCEPTED]-Get list Of Files in a Directory in Foxpro-foxpro

Accepted answer
Score: 14

ADIR() -- create an array based on a directory 1 using whatever wildcard...

local array MyFiles[1,5]
nFilesFound = ADIR( MyFiles, "C:\Somepath\*.dbf" )

for i = 1 to nFilesFound
   ? "Name Of File: ", MyFiles[ i, 1]
   ? "Size: ", MyFiles[ i, 2]
   */ i,3 = date... i,4 = time,  i,5 = attributes
Score: 1

You can also use the File System Object 1 to get more information:

for each fil in fld.files
   ?"Name Of File: ", fil.name
   ?"Size: ", fil.size
   ?"Date created:", fil.DateCreated
   ?"Last modified:", fil.DateLastModified

More Related questions