//--- Returns temporary directory name without trailing backslash
function getTempDir()
local cDir := GetEnv("TEMP")
if empty(cDir)
cDir := GetEnv("TMP")
endif
if Right( cDir, 1 ) == "\"
cDir := SubStr( cDir, 1, Len( cDir ) - 1 )
endif
if !empty(cDir)
if !lIsDir(cDir)
cDir := GetWinDir()
endif
else
cDir := GetWinDir()
endif
return cDir
James Bott wrote:Enrico's solution won't always work.
I used GetEnv( "TEMP" ) for at least 10 years and got no reports about problems with it.
I would consider more correct to put temporary files in the current directory
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 1 guest