In VFP7 and VFP8, if I run sys(2023) on my pc, it returns the VFP temporary folder of c:\foxpro\vfp8\tmp (which I have setup in my config.fpw file using: TMPFILES=C:\FOXPRO\vfp8\TMP\), however, using Anatoly's code it returns the OS environment setting of 'temp' (from SET TEMP=) location of c:\temp (which I setup using environment variables settings under my computer...and is typically c:\windows\temp or c:\documents and settings\< profile >\...)
>Thank you for your help.
>
>On my PC your code returns the same value as sys(2023). Are you suggesting that your code returns name of the TEMP directory more consistently than sys(2023)?
>
>>
>>#DEFINE MAX_PATH 260
>>
>>DECLARE INTEGER GetTempPath IN kernel32;
>> INTEGER nBufferLength, STRING @lpBuffer
>>
>>DECLARE INTEGER GetLongPathName IN kernel32;
>> STRING lpszShortPath, STRING @lpszLongPath, INTEGER cchBuffer
>>
>>? GetLongTempPath()
>>
>>FUNCTION GetLongTempPath
>> LOCAL cPath, cLongPath, nBufsize
>> cPath = Repli(Chr(0),MAX_PATH)
>> cLongPath = Repli(Chr(0),MAX_PATH*2)
>> nBufsize = GetTempPath(Len(cPath), @cPath)
>> cPath = LEFT(cPath, nBufsize)
>> = GetLongPathName(cPath, @cLongPath, Len(cLongPath))
>>RETURN SUBSTR(cLongPath, 1,AT(Chr(0),cLongPath)-1)
>>
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"