Ross Levis wrote: > Hi Tony > > I considered a flag in the file, but there will be a problem if there is > a power cut or PC crash and the flag is left in the file, and everyone > is locked out. It will need some manual utility to reset it. > > Set a "time-out" period on the flag so the flag would automatically revert to "0" if the power failed or the application crashed / hanged. You'll then need a way to keep clocks synchronized across your network.
You might also place the file lock into a separate file so you can use OS-provided locking functions on that. This way you can open the main file without any kind of sharing protection, but when you actually need to write to the file, you try locking the lock file! If the power fails the lock will be freed. _______________________________________________ Delphi mailing list -> Delphi@elists.org http://www.elists.org/mailman/listinfo/delphi