>**DO getfilelist WITH 'c:\*.*','DHS' > >Procedure Getfilelist > Lparameters lcFileSkeleton,lcAttributes,llKeepDirectory > Do RecurseDirectories With lcFileSkeleton,lcAttributes,llKeepDirectory > Wait Clear > If Used('filedirectory') > Index On filepath Tag filepath > Index On filename Tag filename > Index On filesize Tag filesize > Endif > Set Order To filepath && FILEPATH > Go Top > Browse Nowait >Return > >**************************************** >Procedure RecurseDirectories > Lparameters lcFileSkeleton,lcAttributes,llKeepDirectory > Local Array laDirectory[1,1] > Local lnFileCount As Integer > Local lnCounter As Integer > Local lcCurrentPath As Varchar(200) > If Empty(llKeepDirectory) > llKeepDirectory = .F. > Endif > If (!llKeepDirectory) And File('FileDirectory.dbf') > Use In Select('filedirectory') > Delete File filedirectory.Dbf > Endif > If !llKeepDirectory > Create Table filedirectory (filepath Varchar(200),filename Varchar(100), filesize Integer, ModiDate Date, ModiTime Char(16), FileAttr Char(6)) > Endif > If Empty(lcFileSkeleton) > lcFileSkeleton = '*.*' > Endif > If Empty(lcAttributes) > lcAttributes = 'DHS' > Endif > lnFileCount = Adir(laDirectory,lcFileSkeleton,lcAttributes) > lcCurrentPath = Justpath(lcFileSkeleton) > Wait 'Processing: '+Alltrim(lcCurrentPath)+'..hang on!' Window Nowait > If lnFileCount > 0 > For lnCounter = 1 To lnFileCount > If !Empty(Strtran(laDirectory[lncounter,1],'.','')) > If 'D' $ laDirectory[lncounter,5] && directory - need to recursively call! > RecurseDirectories(Addbs(lcCurrentPath)+Addbs(Trim(laDirectory[lncounter,1]))+Justfname(lcFileSkeleton),lcAttributes,.T.) > Else > Insert Into filedirectory (filepath,filename,filesize,ModiDate,ModiTime,FileAttr) Values (lcCurrentPath,laDirectory[lncounter,1],laDirectory[lncounter,2],laDirectory[lncounter,3],laDirectory[lncounter,4],laDirectory[lncounter,5]) > Endif > Endif > Endfor > Endif && lnFileCount > 0 > Return && recursedirectories >Return && getfilelist >>