Re: [sqlite] File checking mechanism.

2012-02-01 Thread Stephan Beal
On Wed, Feb 1, 2012 at 9:07 AM, bhaskarReddy  wrote:

> Suppose i have a file ABCD.db, before i want to create the data
> base file, i want to check whether it is already exit with the same or not.
> If it is exist returns an error.
>

See http://www.sqlite.org/capi3ref.html#sqlite3_open

sqlite3_open_v2() has the ability to require that a DB exists before it is
opened.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] File checking mechanism.

2012-02-01 Thread Abhinav Upadhyay
On Wed, Feb 1, 2012 at 1:37 PM, bhaskarReddy  wrote:
>
> Hi Friends,
>
>         Is there any File checking mechanism in sqilte3.
>
>         Suppose i have a file ABCD.db, before i want to create the data
> base file, i want to check whether it is already exit with the same or not.
> If it is exist returns an error.
>
>         Is there any sqlite function to do file checking mechanism.
>
>
> Regards,
> Bhaskar Reddy

Just do a stat(2) on the file. (see man 2 stat)

--
Abhinav
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users