开发者

Get list Of Files in a Directory in Foxpro

开发者 https://www.devze.com 2023-03-15 06:05 出处:网络
How开发者_JAVA技巧 can i get list of files in a directory programatically in foxpro?ADIR()-- create an array based on a directory using whatever wildcard...

How开发者_JAVA技巧 can i get list of files in a directory programatically in foxpro?


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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消