IIRC SQLite will create a new database file only if (and when) the user enters 
a command that actually accesses the file. This avoids creating empty files if 
the user mistypes the file name. So the desired output might be required to 
appear "later".

Use the already implemented flag -readonly to return an error if the file does 
not exist.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von bob_sql...@mail.com
Gesendet: Dienstag, 22. Jänner 2019 15:29
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] Feature req: Shell .open command should inform 
user what file it opened

In the command shell, the .open command will either open an existing file or 
create a new one if it doesn't already exist. This can be confusing.

It's even more confusing on Windows if the user has forgotten that the path 
should be written with forward slashes instead of the usual Windows backslashes.

This is the situation that baffled me for some time today. Backslashes in the 
path are ignored. So my request to open an existing file was changed to a 
request to open a new file in the default directory. I didn't have permission, 
so Windows put it into the VirtualStore instead.
There was no error message. All I knew was that I was unable to access the data 
as expected. Even the .databases command displayed what appeared to be the 
correct path to the file including the backslashes.

All I'm asking is that the .open command gives a simple response saying if it 
created a new file or opened an existing one and display the actual path and 
filename. This would make it obvious what file had actually been opened. With 
the above user error the directory would display as the default directory and 
the filename would contain all the elements of the user's intended path 
squished together. The message would look something like this.

"Opened new file C:/Program Files/SQLite/UsersBobDocumentsProgTest.sqlite"

The equivalent message if the user had entered the path correctly would be.

    "Opened existing file C:/Users/Bob/Documents/Prog/Test.sqlite"

This would make it clear to the user that the wrong file had been opened.
It seems easily do-able. Hope this helps.

Bob
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to