Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Tommy Ocel
Well, it's already done now. Not a big deal. But if I find any cross-platform problems with my stream reading, I'll try the open call and see if it's quick enough. Thx again. On 4/23/09 7:00 PM, "Mark Spiegel" wrote: I would use the sqlite3_open_V2() call. It won't read read the whole dat

Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Mark Spiegel
I would use the sqlite3_open_V2() call. It won't read read the whole database, just enough to get started, including the header. It will save you having to write and debug your own mechanism. Tommy Ocel wrote: > Hi, > > Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, which

Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Dave Brown
Unless they are encrypted using the encryption extension... On Thu, Apr 23, 2009 at 4:46 PM, Tommy Ocel wrote: > Great. Thanks for the tip. > > > On 4/23/09 4:24 PM, "Igor Tandetnik" wrote: > > Tommy Ocel wrote: > > Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, > > whic

Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Tommy Ocel
Great. Thanks for the tip. On 4/23/09 4:24 PM, "Igor Tandetnik" wrote: Tommy Ocel wrote: > Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, > which would fully load the database and be time-consuming, anybody > know of a quick way to verify that a file is actually a SQLite

Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread John Machin
On 24/04/2009 9:20 AM, Tommy Ocel wrote: > Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, > which would fully load the database and be time-consuming, > anybody know of a quick way to verify that a file is > actually a SQLite3 database file? http://www.sqlite.org/fileformat.

Re: [sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Igor Tandetnik
Tommy Ocel wrote: > Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, > which would fully load the database and be time-consuming, anybody > know of a quick way to verify that a file is actually a SQLite3 > database file? SQLite 3.* database files begin with "SQLite format 3" s

[sqlite] Validating a file is a SQLite DB

2009-04-23 Thread Tommy Ocel
Hi, Other than using sqlite3_open_V2() with a SQLITE_OPEN_READONLY flag, which would fully load the database and be time-consuming, anybody know of a quick way to verify that a file is actually a SQLite3 database file? (I'm reusing a file extension for an upgrade, so want to quickly test if th