Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5 - Can ADIR() return both Short and Long File names
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00871673
Message ID:
00872188
Views:
35
Hi William

>I take this to mean that ADIR lists the SFN's in the order you want. You can just convert them one at a time to LFNs using:

That's is it

I will give this a try. Thanks

>
>FUNCTION Fn2Lfn
>LPARAMETERS pcFileName
>* FN2LFN = "FileName" To "LongFileName"
>*
>*    AUTHOR: Wgcs.. Function derived from sample code posted by
>*             AirCon (IS/IT--Manageme)  on TekTips.com on May 12, 2003
>*      DATE: added LASv10.40, adjusted to convert all parts of the path, May 27, 2003 LASv10.42
>*   PURPOSE: converts an 8.3 or an all-uppercase filename into
>*             it's proper-case long filename.
>* REFERENCE: Used by aasApplication.GetFile
>*     NOTES: If the file isn't found, then the original passed
>*            filename is returned.
>
>Declare Long FindFirstFile in Kernel32 as fnFindFirst ;
>   String cFileName, String @WIN32_DATA
>Declare FindClose in Kernel32 as fnFindClose Long hFile
>LOCAL lcFile, lcBuffer, lcPath, lcLastPath, lcFullPath
>  lcFullPath = ''
>  lcPath     = pcFileName
>  lcLastPath = ''
>
>  do while !(lcPath==lcLastPath)
>    lcLastPath = lcPath
>    lcBuffer   = replicate(chr(0), 318)
>    hFile = fnFindFirst(lcPath, @lcBuffer)
>    If (hFile <= 0)
>      lcFile = JustFName(lcPath)
>    else
>      lcFile = substr(lcBuffer, 45)
>      lcFile = left(lcFile, at(chr(0), lcFile)-1)
>      fnFindClose(hFile)
>    endif
>
>    lcFullPath = iif(Empty(lcFullPath),lcFile,addbs(lcFile)+lcFullPath)
>    lcPath = JustPath(lcPath) && Remove rightmost file/dir reference
>  enddo
>  lcFullPath = AddBS(lcPath)+lcFullpath
>
>  Clear Dlls fnFindFirst, fnFindClose
>  RETURN lcFullPath
>ENDFUNC
>
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform