Post by Shan, Zhe (Jay)I've tried umask, but it does not work for SQLite.
Here are the default permissions used with open()'s O_CREAT flag:
src/os_os2.h:# define SQLITE_DEFAULT_FILE_PERMISSIONS 0600
src/os_unix.c:# define SQLITE_DEFAULT_FILE_PERMISSIONS 0644
But umask still plays a role in this (I can never remember the umask
number's effect without experimentation).
man open:
SYNOPSIS
#include <fcntl.h>
int open(const char *path, int flags, mode_t mode);
DESCRIPTION
The file name specified by path is opened for reading and/or
writing as specified by the argument flags and the file descriptor
returned to the calling process. The flags argument may indicate
the file is to be created if it does not exist (by specifying the
O_CREAT flag), in which case the file is created with mode mode as
described in chmod(2) and modified by the process' umask value (see
umask(2)).
Another option is to create a zero-length sqlite database file yourself
through other means (touch, chmod, etc) before you call sqlite3_open().
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
-----------------------------------------------------------------------------
To unsubscribe, send email to sqlite-users-unsubscribe-CzDROfG0BjIdnm+***@public.gmane.org
-----------------------------------------------------------------------------