On 14 Aug 2012, at 2:57am, daedae11 <daeda...@126.com> wrote: > How can I judge whether a file is a database file? Is there a function that I > can use for this purpose?
You can use the SQLite library call to open it and see whether you get an error back. But it might be better to open the file as binary/text and read the beginning of it. All SQLite files begin with SQLite format 3 and then a 0x00 character. Of course, there's nothing to stop someone writing such a file themself but it would have to be a joke. See <http://www.sqlite.org/fileformat.html> Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users