Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(2023) returning weird values
Message
From
07/04/2017 22:08:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Sys(2023) returning weird values
Miscellaneous
Thread ID:
01649962
Message ID:
01649962
Views:
71
Has anybody encountered situations where SYS(2023) is occasionally not returning a valid temporary folder?

I'm running situation where value could be:
1. blank
2. somewhere in c:\windows\ (or any of the protected directories)
3. sometimes a non-existent folder (usually looking like a portion of a directory name -- e.g. "indows\te")

It seems to be occurring when:
a. it is called within multithreaded DLL
b. it is called in regular application code being run in a remote desktop session

If I try looking at the TEMP environment variable with GETENV(), I'm getting the same sort of results I'm getting with SYS(2023).

For the time being, I've added a kludge so that application code checks to see if SYS(2023) returns invalid folder -- when such a situation is detected, it uses JUSTPATH() to get the folder of one of the tables it happens to have open at that point and use that folder as the temporary folder. It did work around the immediate problem (was frequently getting "access denied" errors before the kludge was added), though the tradeoff has been that now the data folders gets cluttered with temporary files.
Next
Reply
Map
View

Click here to load this message in the networking platform