SQLite Forum

sqlite opens a database file in R/W mode, even if the file is read-only
Login
I'm not seeing this behavior on my own copies of the Windows CLI tools. I get an error if I use a backslash instead of a forward slash, but otherwise opens just fine in old versions.

C:\Data\Programs\SQLite\db>attrib
A    R               C:\Data\Programs\SQLite\db\test2.db

C:\Data\Programs\SQLite\db>cd..

C:\Data\Programs\SQLite>.\3.33.0\sqlite-tools-win32-x86-3330000\sqlite3.exe
SQLite version 3.33.0 2020-08-14 13:23:32
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open .\db\test2.db
Error: unable to open database ".db     est2.db": unable to open database file
sqlite> .open ./db/test2.db
sqlite> .tables
foo
sqlite> .databases
main: C:\Data\Programs\SQLite\db\test2.db
sqlite> .exit

C:\Data\Programs\SQLite>.\3.34.0\sqlite-tools-win32-x86-3340000\sqlite3.exe
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open ./db/test2.db
sqlite> .databases
main: C:\Data\Programs\SQLite\db\test2.db r/o
sqlite>