How do you handle crashes if you have a .lck file?

Eric Forget forgete at cafederic.com
Wed Jan 21 14:37:57 CST 2004


> So I implemented the lck solution to the OSX problem?
> But my question is lets say you crash and the lock
> file still exists? did anyone find a solution to
> getting an expiration for the lck file. You really
> cant depend on your client machines having the correct
> date right?

1) Just write your process id in it. When you reopen check to see if the
process id is not yours that it is still alive.

2) Maybe writing also the delay since login (or boot) could be useful. Just
in case the user crash the application, stop working, shut down the Mac,
later come back, by a bad random pick, the Finder or any other application
opened before your application has the same process id than you had during
the crash.

3) Finally, if the DB is to be opened by different machine/OS, you must also
write something unique for the machine, like the Ethernet card id. But then,
you will have fun to figure out if the process is still running on the other
machine. Maybe we should use rendezvous to find such case.

I would rather prefer that kind of stuff being written at the Valentina
kernel level. Because, whatever we will write, we won't prevent other
Valentina compatible application to create problems. We should probably
making trick to be prevent Valentina application to open the DB, like
encryption on the structure...

Eric

___________________________________________________________________

 Eric Forget                       Cafederic
 ForgetE at cafederic.com             <http://www.cafederic.com/>

 Fingerprint <86D5 38F5 E1FD 5D9C 71C3  BAA3 797E 70A4 6210 C684>




More information about the Valentina mailing list