Am 14.4.06 um 04:30 schrieb Charlie Li:
Is there any way to verify a file is sqlite3 file? When I tried to open a non-sqlite file by sqlite_open(), the system crash. I checked the source codes and found no file type checking. The final trace is toward to page.c file. How to revise code to make sqlite more reliable.
But sqlite does some checking, IIRC - there's a header in each sqlite database file which is even human readable. Take a look at your sqlite files with a hexeditor and you'll see that the first bytes are "SQLite format 3"... IIRC, there's even code in sqlite3 that checks for this sequence. (I assume that sqlite2 did have a similar yet distinctive header)...
</jum>