Best way to maintain single user only status to rev files. Help

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to maintain single user only status to rev files. Help

Dave Herndon
I have 5 stack files that sit on a file server that are accessed from 30 standalone engines on local hard drives.  These files need to be accesible across the WAN and LAN hence the file server location.  When the standalone engine launches a stack on the server it first looks for a file called stackInUse.txt  if it doesnt exist it creates one and puts the user name and time into the first line of the text file if it does exist it denys entry and telld you who is using the program and for how long.  This txt file serves as a gatekeeper to deny entry to other users on the network.   This can be usefull in the event some one leaves the community stack open, others will know who to call to tell to get out of the program.  When the stack closes it deletes the txt file allowing another user to get in.  Rev allows multipe users to use a stack simultaneously on a network but only the last person to save the stack's changes will be saved.  (if the purge stack on close feature is not
 selected the last person to close the standalone on his hard drive's changes will be kept)  Hence the txt file gatekeeper work around.  The problem with this is that in the event of a crash, or if someone logs out of windows with a stack open the stack doesnt get a chance to execute the close stack command and delete the text file.  Then I get a call that no one is using the stack but it is denying entry to all users.  I have to open the folder on the network and drag the stackInUse.txt file to the trash.  (I will build a button to do this shortly)  Any better ideas on how to acomplish this ?
  Dave Herndon
Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

Rob Cozens
Hi Dave,

>Rev allows multipe users to use a stack simultaneously on a network
>but only the last person to save the stack's changes will be saved.
>(if the purge stack on close feature is not selected the last person
>to close the standalone on his hard drive's changes will be kept)
>Hence the txt file gatekeeper work around.  The problem with this is
>that in the event of a crash, or if someone logs out of windows with
>a stack open the stack doesnt get a chance to execute the close
>stack command and delete the text file.  Then I get a call that no
>one is using the stack but it is denying entry to all users.  I have
>to open the folder on the network and drag the stackInUse.txt file
>to the trash.  (I will build a button to do this shortly)  Any
>better ideas on how to acomplish this ?

I don't see room for major improvements within your current design.

I would check the contents of the gatekeeper's .txt file instead of
its existence (empty = access available) so as to avoid the O/S
overhead of creating & deleting the file with each user's access.

Note, FWIW however, that this kind of problem is non sequitur in a
client/server environment.  In SDB, the server application keeps user
& locked record tables in RAM; so if the server crashes, all tables
are cleared, and if a user crashes, the user data for the aborted
logon is erased when the server shuts down.
--

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

sims-6
>Hi Dave,
>
>>Rev allows multipe users to use a stack simultaneously on a network
>  >but only the last person to save the stack's changes will be saved.


When one does this, where is the best place to have that file written?
Is it different for different servers ( Windows, Unix, etc)?

IOW - what directory is best to use for creating that file?

I want to write an identifier to a text file so I can have a limited
number of users with that same identifier use the app...prevent small
companies from purchasing one copy but using it from many seats.

sims


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

Dave Herndon
--- In [hidden email], sims <yahoo@...> wrote:
>
> >Hi Dave,
> >
> >>Rev allows multipe users to use a stack simultaneously on a
network
> >  >but only the last person to save the stack's changes will be
saved.
>
>
> When one does this, where is the best place to have that file
written?
> Is it different for different servers ( Windows, Unix, etc)?
>
> IOW - what directory is best to use for creating that file?
>
> I want to write an identifier to a text file so I can have a
limited
> number of users with that same identifier use the app...prevent
small
> companies from purchasing one copy but using it from many seats.
>
> sims

I have a standalone engine that pretty much just runs 5 files that
sit on the server.  I have the standalone on the C drive check to
see if a Path2file.txt folder exists along side of it.  If it doesnt
exist (as in the first time you use the program) it asks the user to
navigate to the files folder on the server.  Then I have it locate
the database that I use as the backend and also place the name of
the folder where the standalone is.  It puts the paths in line 1 and
line 2 and 3 of the path2file.txt folder.  After that whenever it
launches it uses those paths to locate the files via the set
defaultFolder to "Q/files folder" command.  When a file is opened I
ask the user to select his station location and I put that and the
time in seconds into two items of line 1 of a text file called
filebusy.txt in the Q/file folder on the server. If another user
wants in it tells them that "Station 1 has been using the folder for
2 minutes".  That way if it has been say 15 minutes they can give a
call and say hey... whats up?  It works great unless someone logs
off of windows with the screen open or in the event of a bomb.  
Either way the program doesnt get a chance to delete the file on
closure and then entry is limited.  Fortunatly this happens seldom.
If you want my script let me know.  Interestingly enough I can't
save my files to the server.  I have to set the defaultfolder
property back to the standalone's folder, save the stack to the HD
and then rename it back to the server.  Saving on the win XP server
bombs rev.
Dave





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

sims-6
At 5:02 AM +0000 10/23/06, stocksurfchamp wrote:
>I have a standalone engine that pretty much just runs 5 files that
>sit on the server.  I have the standalone on the C drive check to
>see if a Path2file.txt folder exists along side of it.

<snip>

>If you want my script let me know.
>Dave

Thanks for the offer Dave...I'd very much like to see that script.
Please get in touch.

sims


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

Rob Cozens
In reply to this post by sims-6
>When one does this, where is the best place to have that file written?

In the same folder as the database stacks for which it controls access.(?)
--

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to maintain single user only status to rev files. Help

Ken Ray
In reply to this post by Dave Herndon
On 10/21/06 1:42 AM, "Dave Herndon" <[hidden email]> wrote:

> I have 5 stack files that sit on a file server that are accessed from 30
> standalone engines on local hard drives.  These files need to be accesible
> across the WAN and LAN hence the file server location.  When the standalone
> engine launches a stack on the server it first looks for a file called
> stackInUse.txt  if it doesnt exist it creates one and puts the user name and
> time into the first line of the text file if it does exist it denys entry and
> telld you who is using the program and for how long.  This txt file serves as
> a gatekeeper to deny entry to other users on the network.   This can be
> usefull in the event some one leaves the community stack open, others will
> know who to call to tell to get out of the program.  When the stack closes it
> deletes the txt file allowing another user to get in.  Rev allows multipe
> users to use a stack simultaneously on a network but only the last person to
> save the stack's changes will be saved.  (if the purge stack on close feature
> is not
>  selected the last person to close the standalone on his hard drive's changes
> will be kept)  Hence the txt file gatekeeper work around.  The problem with
> this is that in the event of a crash, or if someone logs out of windows with a
> stack open the stack doesnt get a chance to execute the close stack command
> and delete the text file.  Then I get a call that no one is using the stack
> but it is denying entry to all users.  I have to open the folder on the
> network and drag the stackInUse.txt file to the trash.  (I will build a button
> to do this shortly)  Any better ideas on how to acomplish this ?

One possibility is to have the "owner" of the file write to the file every X
minutes (using "send in ...") and update the date/time in the file. Then,
when other people attempt to connect and check the file, if it has been
longer than X time, it means that the "owner" of the file crashed and it can
reset it to the new user.

I would recommend to be on the safe side that 2X (or more) is a better
interval just in case. So for example, if the amount of time was 5 minutes,
then the owner would update the file every 5 minutes, and if more than 10
minutes passed and the file wasn't updated, it would indicate there had been
a crash (or equivalent), and the new person could take control.





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/revolution_ipc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/revolution_ipc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply | Threaded
Open this post in threaded view
|

Re: Re: Best way to maintain single user only status to rev files. Help

Dave Herndon
In reply to this post by sims-6


sims <[hidden email]> wrote:          At 5:02 AM +0000 10/23/06, stocksurfchamp wrote:
>I have a standalone engine that pretty much just runs 5 files that
>sit on the server. I have the standalone on the C drive check to
>see if a Path2file.txt folder exists along side of it.

<snip>

>If you want my script let me know.
>Dave

Thanks for the offer Dave...I'd very much like to see that script.
Please get in touch.

sims
  Mr, Sims.  Here is the stack script of the standalone.  A lot of the script involves checking the date against a list of dates and passwords located in a splash stack called "about".  If the time gets down to within a couple weeks of expiration it warns the user that its time to re-lease.  If time runs out it bars access tot he program. The stack script is below and the button script is below that. I have been having a little issue with it not counting down right however.  If you clean it up and make it work better let me know.  I havent had a chance to clean it up so it isnt pretty.
  Dave

  on openStack
  global fPathNet, fPathHD,staLoc,fPathToDB
  open stack "about"
  put field "start" of stack "about" into openSecs --last day to use program assigned at start
  close stack "about"
  put the seconds into currentSecs -- the seconds now
  put opensecs - currentSecs into currentSecs ----- the total seconds in between
  divide currentSecs by 86400
  put currentSecs into daysleft
  put char 1 to 3 of daysleft into daysleft -- 1 day worth of seconds
  if daysleft < 21 is true then --start giving 3 weeks notice to re up lease
  put char 1 to 3 of currentSecs into currentSecs
  answer "You have used this program for" && 365 - daysleft & " Days" & return &\
  "You only have" && daysleft && "days left to re-register with FireWorx." & return &\
  "Don't take a chance on losing your input data. Call (put your number here) Now to order."
  if daysleft < 0 is true then
  Answer "Your 1 year lease period is over. Please contact us so we can re - register your account"
  Quit -- remove the dashes when you sell the program. This is the kill switch
  end if
  end if
  put the topstack into stackname
  put daysleft && "Days Left" into field "term" of stackname --how many days left on the lease
  open file "path2file.txt" for read
  read from file "path2file.txt" until EOF
  put it into var2
  close file "path2file.txt"
  if var2 is empty then --put the paths into it empty so fill the file with data
  answer folder "Go Find the folder where the Fireworx Files are located:" put it into line 1 of var1
  put the defaultfolder into line 2 of var1
  answer file "Navigate to the roster.db database on your network" put it into line 3 of var1
  set defaultFolder to line 2 of var1 --tHE TEXT FILE NEEDS TO RESIDE NEXT TO THE ENGINE -- loc of this stack
  open file "path2file.txt" for append
  write var1 to file "path2file.txt"
  close file "path2file.txt" -- its not empty so dont bother with the above just get the info into a gvar
  end if
  open file "path2file.txt" for read
  read from file "path2file.txt" until EOF
  put it into var2
  close file "path2file.txt"
  put line 1 of it into fPathNet
  put line 2 of it into fPathHD
  put line 3 of it into fPathToDB
  set defaultFolder to fPathNet
  answer "Chose your current station location." with "Admin" or "3" or "2" or "1"
  put it into staLoc
  set defaultfolder to fPathNet
  end openStack
  on GoOpenItUp
  set cursor to busy
  global fPathNet, stackToGet, fbusyvar, staLoc
  set the defaultfolder to fPathNet
  put QUOTE & fpathNet & "/" & stackToGet & QUOTE into LongStackName
  if exists(stack stackToGet) is true then
  if there is a file fbusyvar then
  open file fbusyvar for update -- the text file sitting in the file folder
  read from file fbusyvar for 1 line -- lets others know the stack is in use
  close file fbusyvar
  put item 1 of it into startsecs
  put item 2 of it into staLoc
  put the secs into endsecs
  subtract startsecs from endsecs
  if endsecs < 60 then
  answer "Work station" && staloc && "has been using the file for" && endsecs && "seconds."
  exit to top
  end if
  put endsecs div 60 into totalmins
  if totalmins < 30 is true then
  answer "Work station" && staloc && "has been using the file for" && totalmins && "minutes."
  set cursor to hand
  exit to top
  end if
  if totalmins > 30 is true then
  answer "There may be a problem. Work station" && staloc && "has been using the file for" && totalmins && "Minutes"
  answer "Would you like me to reset the File ?" with "Cancel" or "Yes"
  if it is "No" then
  set cursor to hand
  exit to top
  end if
  end if
  end if
 
  put the secs into newsecs
  open file fbusyvar for update
  write newsecs & "," & staLoc to file fbusyvar
  close file fbusyvar
  set the cursor to watch
  open stack stackToGet --- change line
  set the cursor to hand
  else
  answer "Unable to access the" && stackToGet && "program from the FireWorx Files folder."
  end if
  set cursor to hand
  end GoOpenItUp
   
  --The button script below sits on the standalone and acceses the file
  on mouseUp --button script
  global fPathNet, stackToGet, fbusyvar
  put "DRBusy.txt" into fbusyvar
  put "Daily Roster.rev" into stackToGet
  GoOpenItUp
  end mouseup