diff --git a/flaim/src/filesys.h b/flaim/src/filesys.h index d61c776..328976d 100644 --- a/flaim/src/filesys.h +++ b/flaim/src/filesys.h @@ -608,7 +608,6 @@ struct UCUR; // Max file size and log threshold. #define MAX_FILE_SIZE_VER40 ((FLMUINT)0x7FF00000) - #define LOG_THRESHOLD_SIZE ((FLMUINT) 0x40000) FINLINE FLMUINT flmGetMaxFileSize( FLMUINT uiDbVersion, @@ -630,17 +629,11 @@ struct UCUR; // Very large threshhold is the size we will allow the physical // log to grow to before we force a truncation. At the low end, - // it is about 10 megabytes. At the high end it is about + // it is about 32 megabytes. At the high end it is about // 1 gigabyte. - #define LOW_VERY_LARGE_LOG_THRESHOLD_SIZE ((FLMUINT)0xA00000) - #define HIGH_VERY_LARGE_LOG_THRESHOLD_SIZE ((FLMUINT) 0x40000000) - - // RFL_TRUNCATE_SIZE is the size we will let an RFL file grow to - // before we truncate it back. RFL files are only truncated if - // we are configured to delete old RFL files. - - #define RFL_TRUNCATE_SIZE ((FLMUINT)1024 * (FLMUINT)1024 * (FLMUINT)10) + #define LOW_VERY_LARGE_LOG_THRESHOLD_SIZE ((FLMUINT)0x2000000) + #define HIGH_VERY_LARGE_LOG_THRESHOLD_SIZE ((FLMUINT)0x40000000) void ScaCleanupCache( FLMUINT uiMaxLockTime); diff --git a/flaim/src/rfl.cpp b/flaim/src/rfl.cpp index 1956a12..60b5a08 100644 --- a/flaim/src/rfl.cpp +++ b/flaim/src/rfl.cpp @@ -1094,11 +1094,6 @@ RCODE F_Rfl::createFile( goto Exit; } - // Delete the file if it already exists - don't care about return code - // here - - (void) gv_FlmSysData.pFileSystem->deleteFile( szRflFileName); - // If DB is 4.3 or greater and we are in the same directory as our // database files, see if we need to create the subdirectory. // Otherwise, the RFL directory should already have been created. If @@ -1108,7 +1103,6 @@ RCODE F_Rfl::createFile( if (m_bCreateRflDir) { - // If it already exists, don't attempt to create it. if (RC_BAD( rc = gv_FlmSysData.pFileSystem->doesFileExist( m_szRflDir))) @@ -1133,10 +1127,26 @@ RCODE F_Rfl::createFile( f_assert( !m_pFileHdl); - if (RC_BAD( rc = gv_FlmSysData.pFileSystem->createFile( szRflFileName, - gv_FlmSysData.uiFileCreateFlags, &m_pFileHdl))) + if( RC_BAD( rc = gv_FlmSysData.pFileSystem->openFile( szRflFileName, + gv_FlmSysData.uiFileOpenFlags, &m_pFileHdl))) { - goto Exit; + if( rc != FERR_IO_PATH_NOT_FOUND) + { + goto Exit; + } + + if( RC_BAD( rc = gv_FlmSysData.pFileSystem->createFile( szRflFileName, + gv_FlmSysData.uiFileCreateFlags, &m_pFileHdl))) + { + goto Exit; + } + } + else + { + if( RC_BAD( rc = m_pFileHdl->truncate( m_pFile->uiFileExtendSize))) + { + goto Exit; + } } m_pFileHdl->setMaxAutoExtendSize( m_uiRflMaxFileSize);