1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Add the sqlite3OsFileModTime() interface. But it is still unused. The

change counter in page 1 is always incremented. (CVS 1594)

FossilOrigin-Name: 186c6f93e12978907c5f0ff81d90bdf7367b9274
This commit is contained in:
drh
2004-06-15 00:29:03 +00:00
parent 2dd59365ed
commit bf9a7e4d4e
5 changed files with 52 additions and 10 deletions

View File

@@ -1042,4 +1042,22 @@ int sqlite3OsCurrentTime(double *prNow){
return 0;
}
/*
** Find the time that the file was last modified. Write the
** modification time and date as a Julian Day number into *prNow and
** return SQLITE_OK. Return SQLITE_ERROR if the modification
** time cannot be found.
*/
int sqlite3OsFileModTime(OsFile *id, double *prNow){
int rc;
struct stat statbuf;
if( fstat(id->h, &statbuf)==0 ){
*prNow = statbuf.st_mtime/86400.0 + 2440587.5;
rc = SQLITE_OK;
}else{
rc = SQLITE_ERROR;
}
return rc;
}
#endif /* OS_UNIX */