equal
deleted
inserted
replaced
545 |
545 |
546 /** |
546 /** |
547 SQLite OS porting layer API. |
547 SQLite OS porting layer API. |
548 |
548 |
549 Closes the file referred by aDbFile parameter. |
549 Closes the file referred by aDbFile parameter. |
550 If aDbFile, which is actually a pointer to a TDbFile instance, the iFullName data member is not NULL, |
550 If aDbFile.iFullName data member is not NULL, then the file will be deleted. |
551 then the file will be deleted. |
|
552 |
551 |
553 @param aDbFile A pointer to a TDbFile instance, than contains the file handle to be closed. |
552 @param aDbFile A pointer to a TDbFile instance, than contains the file handle to be closed. |
554 |
553 |
555 @return SQLITE_OK |
554 @return SQLITE_OK |
556 |
555 |
560 { |
559 { |
561 SQLUTRACE_PROFILER(aDbFile); |
560 SQLUTRACE_PROFILER(aDbFile); |
562 TDbFile& dbFile = ::DbFile(aDbFile); |
561 TDbFile& dbFile = ::DbFile(aDbFile); |
563 dbFile.iFileBuf.Close(); |
562 dbFile.iFileBuf.Close(); |
564 if(dbFile.iFullName) |
563 if(dbFile.iFullName) |
565 { |
564 {//"iFullName" will not be NULL only when TVfs::Open() is called with SQLITE_OPEN_DELETEONCLOSE flag. |
|
565 //That means - SQlite expects the file to be deleted after the file close operation. |
566 (void)TStaticFs::Fs().Delete(*dbFile.iFullName); |
566 (void)TStaticFs::Fs().Delete(*dbFile.iFullName); |
567 delete dbFile.iFullName; |
567 delete dbFile.iFullName; |
568 dbFile.iFullName = NULL; |
568 dbFile.iFullName = NULL; |
569 } |
569 } |
570 OpenCounter(-1); |
570 OpenCounter(-1); |