SQLite Forum

Best way check if a file is a SQLite DB?
Login
Note that using sqlite3_open() doesn't do anything with the file at all.  It just sets up a structure in memory.  SQLite only looks at the file on storage when you try to do the first thing that needs to know what's in it.

I'd go with your other answer: check the file header to see whether it matches the file-structure documentation.