On 12/19/07, Dave Dyer <[EMAIL PROTECTED]> wrote: > > Is there an officially sanctioned magic number test to recognize > a sqlite database? I'd like to allow a user to browse for a file, > and if it happens to be a sqlite database to take a separate path. >
You could read the file and check for the first few bytes... on my computer Lucknow:~ punkish$ sqlite3 foo SQLite version 3.4.2 Enter ".help" for instructions sqlite> create table bar (a); sqlite> insert into bar values ('blah'); sqlite> .q Lucknow:~ punkish$ ls -l f* -rw-r--r-- 1 punkish punkish 2048 Dec 19 13:44 foo Lucknow:~ punkish$ Lucknow:~ punkish$ less foo SQLite format [EMAIL PROTECTED]@^A^A^@@ [EMAIL PROTECTED]@[EMAIL PROTECTED] and so on... ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------