Hi!
There is an Windows API function to get short file name from long (do not remember which, let me know if you cannot find it).
Just a suggestion:
Try: ADIR(aDirs,"DHS"), "MSCREATE.DIR" folder is usually marked as hidden, but ADIR(aDirs,"D") do not see hidden directories. Just check if this is true...
Good reason to upgrade to VFP7 - ADIR in there allows getting short file names in result array, as well as return file names in original case (in older versions files are in all uppercase).
>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
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.