application_id / magic.txt

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

application_id / magic.txt

Stephen Chrzanowski
Documented here:
http://www.sqlite.org/src/artifact?ci=trunk&filename=magic.txt

I have a routine that SPECIFICALLY looks for "SQLite format 3"+#0 to
validate that the file in question is indeed a SQLite3 file hopefully prior
to actually opening any SQLite type of file handler on the actual file.

If I wanted to, I COULD possibly set the application ID at DB creation and
add to my routine to validate that the application is opening the file I
need it to?

Also, is 68 a HEX value or DEC value?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: application_id / magic.txt

Simon Slavin-3


On 30 Jul 2017, at 9:34pm, Stephen Chrzanowski <[hidden email]> wrote:

> Documented here:
> http://www.sqlite.org/src/artifact?ci=trunk&filename=magic.txt
>
> I have a routine that SPECIFICALLY looks for "SQLite format 3"+#0 to
> validate that the file in question is indeed a SQLite3 file hopefully prior
> to actually opening any SQLite type of file handler on the actual file.
>
> If I wanted to, I COULD possibly set the application ID at DB creation and
> add to my routine to validate that the application is opening the file I
> need it to?

I’d recommend that you don’t do that.  I’ve seen at least one SQLite utility (called something like "Sqlite DB Manager" but not the well-known one) which stomps on that value when copying or reconstructing the database.

> Also, is 68 a HEX value or DEC value?

Decimal.  See section 1.2 of

<https://sqlite.org/fileformat.html>

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...