Code: Select all
function cTempFile( cPath, cExtension ) // returns a temporary filename
local cFileName
static cOldName
DEFAULT cPath := "", cExtension := ""
if ! "." $ cExtension
cExtension = "." + cExtension
endif
while File( cFileName := ( cPath + LTrim( Str( GetTickCount() ) ) + cExtension ) ) .or. ;
cFileName == cOldName
end
cOldName = cFileName
return cFileName