Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to do ADIR enhancement..
Message
From
11/09/2001 03:27:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
I need to do ADIR enhancement..
Miscellaneous
Thread ID:
00555009
Message ID:
00555009
Views:
62
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
                               * Nothing to convert
                               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.
Next
Reply
Map
View

Click here to load this message in the networking platform