On Mon, 22 Aug 2005, Edwin Knoppert wrote: > Confirmed but open still opens the textfile, i wish it cancelled that as > well. > There is no use to an open textfile for sqlite. >
I must say I agree. Perhaps there is some verry good reason to delay actually opening the DB untill the first real access. But it sounds like optimizing for the "open, do nothing, close" case, which is probably not that common. So most of the time the database will eventually be opened, why not do right away? Is there any real benefit? This way it makes things harder for the application programmer. Instead of beeing able to determine from the result of the open call (I don't know the C API) if the database was succesfully opened and can be used, you have to perform some (dummy) access to the database in order to find out. Again, maybe there is a verry good reason to do it the way it is. But if the common case is that the database will be opened anyway, why not do it at a time and in a way that can be put to good use by the application (programmer)? Just my 0.02 Regards, Mark. > ----- Original Message ----- > From: "D. Richard Hipp" <[EMAIL PROTECTED]> > To: <sqlite-users@sqlite.org> > Sent: Monday, August 22, 2005 5:54 PM > Subject: Re: [sqlite] Why can i open a textfile? > > > > On Mon, 2005-08-22 at 08:42 -0700, Clark Christensen wrote: > >> > >> --- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > >> > ... > >> > SQLite never "blows away" a file that is not a database. > >> > > >> > -- > >> > D. Richard Hipp <[EMAIL PROTECTED]> > >> > >> Sorry to report this doesn't seem to be the case. At least > >> not under Windows. Using v3.2.2, I can "sqlite3 junk.txt", > >> then "create table junk (a,b)", and the text file becomes a > >> SQLite3 database :-( > >> > >> FWIW, junk.txt contained several lines of text before > >> becoming a database. > >> > > > > See http://www.sqlite.org/cvstrac/tktview?tn=1370 > > The problem has been fixed in version 3.2.3. > > -- > > D. Richard Hipp <[EMAIL PROTECTED]> > > > > > > Regards, Mark