Enrico,
There is a downside to putting temp files in the current directory when the program is being run from a server. This slows down the application.
It might be better (when TEMP isn't found) to check for c:\temp and if it doesn't exist, then create it and use this instead.
I know most Windows versions have a c:\windows\temp but some versions have security which won't allow users write access to it.
There is also an upside to using the server to hold temp files, and that is that any orphan temp files can be periodically deleted either by the application or an administrator.
James
function that return the temp directory of the logged user
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
-
- Posts: 54
- Joined: Fri Oct 21, 2005 10:45 am
- Location: Russia, Moscow
- Contact:
Or you can use the following API call to get the windows temp folder IF they have access to it.
function get_temp()
local tbuffer:=space(256)
gettemppath(256,@tbuffer)
tbuffer := LEFT(tbuffer,AT(CHR(0),tbuffer)-1)
return(tbuffer)
DLL32 Function GetTempPath( bufferlen as LONG, tbuffer AS LPSTR) AS LONG ;
PASCAL FROM "GetTempPathA" LIB "kernel32.dll"
function get_temp()
local tbuffer:=space(256)
gettemppath(256,@tbuffer)
tbuffer := LEFT(tbuffer,AT(CHR(0),tbuffer)-1)
return(tbuffer)
DLL32 Function GetTempPath( bufferlen as LONG, tbuffer AS LPSTR) AS LONG ;
PASCAL FROM "GetTempPathA" LIB "kernel32.dll"