Re: [sqlite] Read/Write permission

2004-06-09 Thread shamil_daghestani

Ops... I forget that replying to a message sent to sqlite-users goes only
to the originator and not to the group.

Anyway, I looked through sqlite.org but couldn't find how to properly open
an sqlite database in read-only mode.  If any knows how to do so
(preferably in TCL binding), please let me know.

-Shamil




   
   
  Darren Duncan  
   
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
  
  can.net cc: 
   
   Subject:  Re: [sqlite] Read/Write 
permission   
  06/09/2004 03:41 
   
  PM   
   
   
   
   
   




At 3:35 PM -0400 6/9/04, [EMAIL PROTECTED] wrote:
I'm working on a TCL binding of SQLite database, which is sitting
somewhere
in a shared folder at my company.  Few would write to it, but many others
will read from it.  Therefore, in order to protect that database (and
other
files in the same location) from accidents, the few that will write to it
have read/write permission to that folder, and all others have just
read permission.  I quickly discovered that those with only read
permission to that folder cannot access the SQLite database to be able to
read from it!  Is this the expect behavior?

SQLite is probably trying to open the database in read/write mode by
default, which wouldn't work if the folder is read-only.  I think you
need to change your call to 'open' so that it explicitely says to do
it read-only. -- Darren Duncan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








The information transmitted is intended only for the person(s)or entity 
to which it is addressed and may contain confidential and/or legally 
privileged material. Delivery of this message to any person other than 
the intended recipient(s) is not intended in any way to waive privilege 
or confidentiality. Any review, retransmission, dissemination or other 
use of , or taking of any action in reliance upon, this information by 
entities other than the intended recipient is prohibited. If you 
receive this in error, please contact the sender and delete the 
material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Read/Write permission

2004-06-09 Thread Randy J. Ray
[EMAIL PROTECTED] wrote:
Anyway, I looked through sqlite.org but couldn't find how to properly open
an sqlite database in read-only mode.  If any knows how to do so
(preferably in TCL binding), please let me know.
According to the docs on the C/C++ bindings, the mode argument to open() does 
this, except that it is currently ignored. Since any other language bindings 
(including Tcl) are based on the C bindings, this means that you simply can't 
open the DB read-only.

Randy
--
[EMAIL PROTECTED]  http://www.rjray.org http://www.svsm.org
Always code as if the guy who ends up maintaining your code will be a violent
psychopath who knows where you live.  -- Rick Osborne
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Read/Write permission

2004-06-09 Thread Kurt Welgehausen
Try setting permissions to read-only for the file, not
for the whole directory.

**kaw~/sqlite$ v sp
-r--r--r--1 kaw  users8192 Jan  1 12:41 sp
**kaw~/sqlite$ tclsh
% load tclsqlite.so
% sqlite db sp
0x806fb50
% db eval {select * from S}
S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 
Athens
% db eval {insert into S (Sno, Sname, Status, City) \
values ('S6', 'Dunn', 25, 'Rome')}
attempt to write a readonly database


Regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]