Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(2023) returning weird values
Message
 
To
07/04/2017 22:08:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01649962
Message ID:
01649964
Views:
77
I've seen "File access denied" in situations in which the app/exe runs with different credentials than current user's, and the impersonator did not have sufficient rights to the user temp folder. A quick test would be to give full rights to Everyone to the user temp folder and see if that works.
Otherwise, another way to get the path to the temp folder (that is in case that cursors can be created in the user temp folder) is to SQL create/select a cursor and then use JUSTPATH(DBF())

>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform