wearem@topaz.ucq.edu.au (05/21/91)
Has anyone had any experience with using a file with HyperCard over a network. What we would like to do is to be able to give a user exclusive access to a file at any time from the point is has been opened until it has been finished with. (Usually less than 2 seconds). Does anyone know of a way to 'lock' this file for use, or some form of equivalent means that would suit our purposes. Could you please reply either direct to me or post a message to this group. Thank you in advance Michael Weare wearem@pinjel.ucq.edu.au School Of Health Science University College Of Central Queensland ROCKHAMPTON AUSTRALIA
Paul.Heller@p391.f421.n109.z1.FidoNet.Org (Paul Heller) (05/23/91)
--> Has anyone had any experience with using a file with HyperCard over a --> network. What we would like to do is to be able to give a user --> exclusive access to a file at any time from the point is has been --> opened until it has been finished with. (Usually less than 2 seconds). --> Does anyone know of a way to 'lock' this file for use, or some form --> of equivalent means that would suit our purposes. --> --> Could you please reply either direct to me or post a message to this --> group. You could always handle file locking by using flag files that would exist only while the target file was "locked." Before writing to the target file, your HC script could use the FileExists XFCN to see if, say, ITSLOCKED.FLG exists. If it doesn't, the script would create it by writing something to it, then do its thing with the target file, close the target file, then delete ITSLOCKED.FLG. If the file does exist, it can sit in a repeat loop waiting for the file to go away, signifying that the file is no longer in use. If you have a lot of users, timing is going to be tricky, and you may need to put a random pause in place before the check, otherwise 2 or more people could wind up waiting for the file at the same time, and simultaneously decide to "go for it" when the flag disappears. This should work, though it's a tad dangerous compared to using a real database package, such as FileMaker. I use HC for big CD-ROM things, but over the past couple of years have been burned sufficiently often by corrupted stacks even with single-user scenarios that I realy hesitate to use HC for "live" data. I got a strongly-worded note from Apple DTS a year or so ago that stressed that HC is NOT a database package & shouldn't be mistaken for one unless one likes living on the edge; I was annoyed at the time, but experience has convinced me. * Origin: Clone Point West (1:109/421.391)