I need to create a new temp table ListFile.dbf with listing out all files with correct filter parameters passing..
ListFile ( FileName C(128), fExt C(3), fPath C(128), fShortNam C(128) )
I want to write a function FDIR to make a new content of this dbf file.
PROCEDURE FDIR
LPARAMETERS pPATH, pFILTER, pRECURSIVE
So that I can check out all the Scan image files in some subdir got filled in database ITEM or not.
and also I can do other task such as delete all MSCREATE.DIR (dummy 0 byte files)
Since I still using VFP 5.0, ADIR(arDirs, [D]) can't give all directory name...
I very need help to finish the code.
Thanks a lot.
I only find the short name function from FAQ on Short name of file...
FUNCTION GetShortNameFromLong
LPARAMETER cPathToConvert
LOCAL cBuf, nBufSize, nShortSize
IF TYPE('cPathToConvert') # 'C' OR LEN(cPathToConvert) = 0
RETURN ''
ENDIF
DECLARE INTEGER GetShortPathName IN Win32API ;
STRING @cLongPath, ;
STRING @cShortPathBuff, ;
INTEGER nBuffSize
cBuf= SPACE(511)
nBufSize = 511
nShortSize = GetShortPathName(cPathToConvert,@cBuf,@nBufSize)
IF nShortSize > 0
RETURN LEFT(cBuf,nShortSize)
ELSE
RETURN ''
ENDIF
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.