Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Keeping track of what users have files locked in file sharing mode
Sat, Jul 21 2007 8:24 PMPermanent Link

"Huhtaman"
Hello All:

   I want to keep track of what users have a file or files open or locked
in the system so that the administrators can find out who is in them more
easily when a patch/upgrade must be applied.

   I am using file sharing not client server mode.

  It does not have to be fool proof -- a 98% accurate solution would be
fine.

  And I dont need to do all files - just 2 or 3 selected files.

   I thought about maybe creating a login/logout proc as follows:

     1) On app startup a computer(s) credentials would be entered and the
start record stored
     2) On app normal termination this record would be marked done or
deleted
     3) In an on idle event - update a timestamp on the record every minute

   Then I could scan for records in the system that are "open" - filter out
aborted sessions by removing any records without a recent time stamp.

   Is there a better way to do this ??? Any thoughts would be appreciated.
Thank you.

Neil

Sun, Jul 22 2007 8:04 AMPermanent Link

"Robert"
Use a sempahore. Very easy to use, and gets automatically deleted when the
application closes.

This is more or less how I do it.

When the application starts, loop through the table attempting to set a
semaphore until you are successful (that is, until you found an empty slot).
Then I store that semaphore number in the datamodule (or any other global).
That is my signon number.

To determine if there are other users, I loop thru the semaphores to see if
there is any one other than my number set.

You can use that technique to count number of users, when your license
limits the number of users.

Robert
"Huhtaman" <nhuhta@digital.net> wrote in message
news:D1397FFA-AACA-4B62-930E-4FC4D55BDE49@news.elevatesoft.com...
> Hello All:
>
>    I want to keep track of what users have a file or files open or locked
> in the system so that the administrators can find out who is in them more
> easily when a patch/upgrade must be applied.
>
>    I am using file sharing not client server mode.
>
>   It does not have to be fool proof -- a 98% accurate solution would be
> fine.
>
>   And I dont need to do all files - just 2 or 3 selected files.
>
>    I thought about maybe creating a login/logout proc as follows:
>
>      1) On app startup a computer(s) credentials would be entered and the
> start record stored
>      2) On app normal termination this record would be marked done or
> deleted
>      3) In an on idle event - update a timestamp on the record every
> minute
>
>    Then I could scan for records in the system that are "open" - filter
> out aborted sessions by removing any records without a recent time stamp.
>
>    Is there a better way to do this ??? Any thoughts would be appreciated.
> Thank you.
>
> Neil
>
>

Image