model_server/machine_prefs/src/evalMetaChars.h.cxx
//------------------------------
// remove the temp directory on NT
//------------------------------
remove the temp directory on NT
remove the temp directory on NT
void remove_tmp_dir()
{
#ifdef _WIN32
	if (pfDiscoverLockFile)
	{
		int nResult=0;
		nResult=pfDiscoverLockFile->unlock(0, 1);
		const char * pContents2="This file is no longer in use by DISCOVER";
		nResult=pfDiscoverLockFile->write((char *)pContents2, pdstrlen(pContents2));
		nResult=pfDiscoverLockFile->close(0);
		delete pfDiscoverLockFile;
	}
	const char* pszTmpDir = OSapi_getenv("TMPDIR");
	const char  szPattDis[] = "DISCOVER-";
	pszTmpDir = OSPATH(pszTmpDir);
	if ( strstr( pszTmpDir, convert_to_uniform_case(szPattDis)) )
	{
		char* cmd = new char [ sizeof("rmdir /s /q ") + strlen(pszTmpDir) + 3 ];
		if ( cmd )
		{
			strcpy( cmd, "rmdir /s /q \"" );
			strcat( cmd, convert_forward_slashes( pszTmpDir ) );
                        strcat( cmd, "\"");
			system( cmd );
		}
	}
#endif
}
void remove_tmp_dir ( ) { #ifdef _WIN32 if ( pfDiscoverLockFile ) { int nResult = 0 ; nResult = pfDiscoverLockFile -> unlock ( 0 , 1 ) ; const char * pContents2 = " " ; nResult = pfDiscoverLockFile -> write ( ( char * ) pContents2 , pdstrlen ( pContents2 ) ) ; nResult = pfDiscoverLockFile -> close ( 0 ) ; delete pfDiscoverLockFile ; } const char * pszTmpDir = OSapi_getenv ( " " ) ; const char szPattDis [ ] = " " ; pszTmpDir = OSPATH ( pszTmpDir ) ; if ( strstr ( pszTmpDir , convert_to_uniform_case ( szPattDis ) ) ) { char * cmd = new char [ sizeof ( " " ) + strlen ( pszTmpDir ) + 3 ] ; if ( cmd ) { strcpy ( cmd , " \" " ) ; strcat ( cmd , convert_forward_slashes ( pszTmpDir ) ) ; strcat ( cmd , " \" " ) ; system ( cmd ) ; } } #endif }
remove the temp directory on NT
remove the temp directory on NT
//////////////////////////////////////////// // deal with the lock file ///////////////////////////////////////////