FString FPaths::CreateTempFilename( const TCHAR* Path, const TCHAR* Prefix, const TCHAR* Extension )
{
// … SNIP …
if( PathLen > 0 && Path[ PathLen - 1 ] != TEXT(’/’) )
{
UniqueFilename = FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix, *FGuid::NewGuid().ToString(), Extension );
}
else
{
UniqueFilename = FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix, *FGuid::NewGuid().ToString(), Extension );
}
// … SNIP …
}
Note that both the if and the else use the same format string, so even if Path ends with a /, the returned filename will be in the form Path//PrefixGUIDExtension.