Re: [sqlite] sqlite database "signature" ?

2009-08-06 Thread John Machin
On 7/08/2009 2:36 AM, luc.moulinier wrote:

> I'd like to know what is the best way to know if a file
 > is a sqlite DB or not (without launching sqlite of course) ?
 > For example, is the first line of the file unambiguously
 > a signature of sqlite ? If so, what is its structure ?

http://www.sqlite.org/fileformat.html#database_header

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite database "signature" ?

2009-08-06 Thread robin wen
Yeah, in my project I just check if the file content starts with this string
to see if it's a Sqlite3 file.

I don't think of a way that could guarantee the "unambiguously".


2009/8/7 P Kishor 

> On Thu, Aug 6, 2009 at 11:36 AM, luc.moulinier
> wrote:
> > Hello !
> >
> > I'd like to know what is the best way to know if a file is a sqlite DB or
> not (without launching sqlite of course) ? For example, is the first line of
> the file unambiguously a signature of sqlite ? If so, what is its structure
> ?
>
> 'SQLite format 3'
>
> although, I am not sure what you expect from 'unambiguously'? I mean,
> while all files created by sqlite3 will start with the above string,
> that doesn't stop me or you from creating a spurious binary file that
> will start with the same string.
>
> Recognize at your own risk.
>
> > Many thanks in advance !
> > Luc
> >
> >
> >  Créez votre adresse électronique prenom@laposte.net
> >  1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Puneet Kishor http://www.punkish.org
> Carbon Model http://carbonmodel.org
> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
> Nelson Institute, UW-Madison http://www.nelson.wisc.edu
> ---
> Assertions are politics; backing up assertions with evidence is science
> ===
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite database "signature" ?

2009-08-06 Thread Rich Shepard
On Thu, 6 Aug 2009, luc.moulinier wrote:

> I'd like to know what is the best way to know if a file is a sqlite DB or
> not (without launching sqlite of course) ? For example, is the first line
> of the file unambiguously a signature of sqlite ? If so, what is its
> structure ? Many thanks in advance ! Luc

   The first 16 bytes are:
SQLite format 3

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
 Voice: 503-667-4517  Fax: 503-667-8863
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite database "signature" ?

2009-08-06 Thread luc.moulinier
Hello !

I'd like to know what is the best way to know if a file is a sqlite DB or not 
(without launching sqlite of course) ? For example, is the first line of the 
file unambiguously a signature of sqlite ? If so, what is its structure ?
Many thanks in advance !
Luc


 Créez votre adresse électronique prenom@laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users