Page 2 of 2

PostPosted: Tue Mar 14, 2006 5:13 pm
by James Bott
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

PostPosted: Tue Mar 14, 2006 5:34 pm
by Enrico Maria Giordano
Agreed.

EMG

PostPosted: Wed Mar 15, 2006 12:54 pm
by Vladimir Grigoriev
After reading I can conclude that idea to have a program parameter which specifies a temp directory (for example, MyProg /TMP:c:\somepath) deserves consideration. :D

PostPosted: Wed Mar 22, 2006 10:47 pm
by Mdandrea
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"