Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to setup sys(2023)
Message
De
07/05/2003 09:56:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00785617
Message ID:
00785779
Vues:
40
What OS does the customer run? If it is Windows 2000 or Windows XP editing the autoexec.bat will not add the temp variable to the environment. It will work however if the customer is running 95 or 98. Also, does the customer physically have a c:\temp folder? I always create one manually (or programmatically) as it does not exist by default.

>So I guess sys(2023) first looks at the config.fpw and then at GetTempPath().
>The message from Aleksey was also helpful as he describes the steps VFP takes to get the temp directory. And I already sent a message to the customer (who is on the west coast so I won't know the result until later today) to add the line "SET TEMP=C:\TEMP" to their autoexec.bat file.
>This, hopefully, will solve my problem.
>Thank you for your input.
>
>>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"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform