On 8/13/07, Chase <[EMAIL PROTECTED]> wrote:
>
> is there any way (in c/c++) to find out how many current connections
> there are to a database that i am connected to?
>
> i'd like to do some housekeeping on the database every so often, but
> only if there's no one else connected to it at the time.

If you're on a Linux system, you can shell out and run "lsof
/path/to/sql.db" and see all the processes that have the file opened.
You may need to run as root to see all the users, and you should use
the output as a guide, since by the time you parse it, some users may
have quit, others could have joined.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to