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:
24
src/os.c
24
src/os.c
@@ -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,
|
||||
|
Reference in New Issue
Block a user