*... Create Cursor (m.tcCursorName) ; (filepath M NOCPTRANS, filename M NOCPTRANS, ; FileSize i, fattr c(8), createtime T, lastacc T, lastwrite T) *...MartinaJ
lcStartDir = "c:\" >lnFiles = GetTree(m.lcStartDir,'*.doc', 'myCursor', .t.) >Select * from myCursor order by filepath,filename > >Function GetTree >Lparameters tcStartDir,tcSkeleton,tcCursorName,; > tlSubfolders,; > tlWholeWords,tlIgnoreCase,tlSearchAnd,tcSearch1,tcSearch2,tcSearch3 >Create Cursor (m.tcCursorName) ; > (filepath c(250), filename c(250), ; > FileSize i, fattr c(8), createtime T, lastacc T, lastwrite T) >Local oFiler, lnFound >oFiler = Createobject('filer.fileutil') >With oFiler > .SearchPath = m.tcStartDir > .FileExpression = m.tcSkeleton && Search for skeleton > .Subfolder = iif(m.tlSubfolders,1,0) && Check subfolders > .IgnoreCase = iif(m.tlIgnoreCase,1,0) > .WholeWords = iif(m.tlWholeWords,1,0) > .SearchAnd = iif(m.tlSearchAnd,1,0) > .SearchText1 = 'YXYXYXY'&&iif(empty(m.tcSearch1),"",m.tcSearch1)*****************************Here I will find all docs with 'YXYXYXY' content, but not hebrew string > .SearchText2 = iif(empty(m.tcSearch2),"",m.tcSearch2) > .SearchText3 = iif(empty(m.tcSearch3),"",m.tcSearch3) > lnFound = .Find(0) > For ix=1 To m.lnFound > With .Files(ix) > If !(Bittest(.Attr,4) And .Name = '.') > Insert Into (tcCursorName) ; > (filepath, filename, FileSize, fattr, createtime, lastacc, lastwrite) ; > values ; > (.Path, .Name, .Size, Attr2Char(.Attr), ; > Num2Time(.Datetime), Num2Time(.LastAccessTime), Num2Time(.LastWriteTime)) > Endif > Endwith > Endfor >Endwith >Return lnFound > >Function Num2Time >Lparameters tnFloat >Return Dtot({^1899/12/30}+Int(m.tnFloat))+86400*(m.tnFloat-Int(m.tnFloat)) > >Function Attr2Char >Lparameters tnAttr >Return ; > IIF(Bittest(tnAttr,0),'RO','RW')+; > IIF(Bittest(tnAttr,1),'H','_')+; > IIF(Bittest(tnAttr,2),'S','_')+; > IIF(Bittest(tnAttr,4),'D','_')+; > IIF(Bittest(tnAttr,5),'A','_')+; > IIF(Bittest(tnAttr,6),'E','_')+; > IIF(Bittest(tnAttr,7),'N','_') >