mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Add the SQLITE_FCNTL_TEMPFILENAME file control that asks the underlying VFS
to return a new temporary filename. Per request from NSS team at Mozilla. FossilOrigin-Name: 1a63b1d5fa5d79f96eddbda6d94bc10248863710
This commit is contained in:
11
src/os_win.c
11
src/os_win.c
@@ -2691,6 +2691,9 @@ static void winModeBit(winFile *pFile, unsigned char mask, int *pArg){
|
||||
}
|
||||
}
|
||||
|
||||
/* Forward declaration */
|
||||
static int getTempname(int nBuf, char *zBuf);
|
||||
|
||||
/*
|
||||
** Control and query of the open file handle.
|
||||
*/
|
||||
@@ -2751,6 +2754,14 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_TEMPFILENAME: {
|
||||
char *zTFile = sqlite3_malloc( pFile->pVfs->mxPathname );
|
||||
if( zTFile ){
|
||||
getTempname(pFile->pVfs->mxPathname, zTFile);
|
||||
*(char**)pArg = zTFile;
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
}
|
||||
return SQLITE_NOTFOUND;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user