1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Modifications to the VDBE to support more than one database file. (CVS 878)

FossilOrigin-Name: 875da9eed981bfa27b98e95025f9fdbed74b4098
This commit is contained in:
drh
2003-03-19 03:14:00 +00:00
parent 9468c7f489
commit 001bbcbb8f
19 changed files with 451 additions and 266 deletions

View File

@@ -268,6 +268,30 @@ int sqliteOsFileExists(const char *zFilename){
}
/*
** Change the name of an existing file.
*/
int sqliteOsRename(const char *zOldName, const char *zNewName){
#if OS_UNIX
if( link(zOldName, zNewName) ){
return SQLITE_ERROR;
}
unlink(zOldName);
return SQLITE_OK;
#endif
#if OS_WIN
if( !MoveFile(zOldName, zNewName) ){
return SQLITE_ERROR;
}
return SQLITE_OK;
#endif
#if OS_MAC
/**** FIX ME ***/
return SQLITE_ERROR;
#endif
}
/*
** Attempt to open a file for both reading and writing. If that
** fails, try opening it read-only. If the file does not exist,