Get list Of Files in a Directory in Foxpro

2019-08-12 10:06发布

How can i get list of files in a directory programatically in foxpro?

2条回答
Summer. ? 凉城
2楼-- · 2019-08-12 10:59

You can also use the File System Object 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
查看更多
Ridiculous、
3楼-- · 2019-08-12 11:04

ADIR() -- create an array based on a directory 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
查看更多
登录 后发表回答