[ACCEPTED]-Get list Of Files in a Directory in Foxpro-foxpro
Accepted answer
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
endfor
You can also use the File System Object 1 to get more information:
fso=createobject("scripting.filesystemobject")
fld=fso.getfolder(lcFolderName)
for each fil in fld.files
?"Name Of File: ", fil.name
?"Size: ", fil.size
?"Date created:", fil.DateCreated
?"Last modified:", fil.DateLastModified
next
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.