百万个?win也崩吧
LPARAMETERS lcpath
DECLARE INTEGER FindFirstFile IN kernel32 STRING lpFileName,STRING @ lpFindFileData
DECLARE INTEGER FindNextFile IN kernel32 INTEGER hFindFile,STRING @ lpFindFileData
DECLARE INTEGER FindClose IN kernel32 INTEGER hFindFile
local cFilename,cFindBuffer,hFind,lnAttr,hCountF,hCountD,nRecn
lcPath=ADDBS(ALLTRIM(lcpath))
IF DIRECTORY(lcpath)
cFindBuffer = Repli(Chr(0),318)
hCountD=1
LOCAL hDIRECT(1)
hDIRECT[1]=""
hCountF=0
nRecn=0
DO WHIL nRecn<hCountD
nRecn=nRecn+1
hFind = FindFirstFile(lcpath+hDIRECT(nRecn) + "*.*", @cFindBuffer)
IF hFind = -1
loop
ELSE
lnAttr = ctobin(SUBSTR(cFindBuffer, 1,4),'4rs')
cFilename = SUBSTR(cFindBuffer, 45,260)
cFilename = Left(cFilename, AT(Chr(0),cFilename)-1)
ENDIF
DO WHILE .T.
IF BITand(lnAttr,16) =16
IF Not (LEFT(cFilename,1)="."
or AT('RECYCLER',UPPER(cfilename))>0)
hCountD=hCountD+1
local hDIRECT[hCountD]
hDIRECT[hCountD]=hDIRECT(nRecn)+cFilename+'\'
ENDIF
ELSE
*
?hDIRECT(nRecn)+cFilename
ENDIF
IF FindNextFile(hFind, @cFindBuffer) = 0
EXIT
ELSE
lnAttr = ctobin(SUBSTR(cFindBuffer, 1,4),'4rs')
cFilename = SUBSTR(cFindBuffer, 45,260)
cFilename = Left(cFilename, AT(Chr(0),cFilename)-1)
ENDIF
ENDDO
FindClose(hFind)
ENDDO
else
hCountD=0
hCountF=1
local hFile[1]
hFile[1]=lcpath
endif
RETURN