On 11/4/2018 9:10 PM, David T. via gnucash-user wrote:
As others explained, the lck and lnk files are created by gnucash to prevent 
users accidentally opening the data file on multiple machines. They are zero 
bytes in size and there is no point in trying to open them up. There is no 
there there.
Sometimes it can help people remember if they are told why.

Why a file with no data? The lock file isn't intended to be OPENED. Only its EXISTENCE is being tested. That's what it is there for. If it exists, then some instance of the program has the corresponding data file open. When gnucash is about to open a data file, it creates a corresponding lock file, and when it closes that data file, it deletes the lock file. The existence of a lock file (for some data file) means that an instance of the program "owns" that data file, and no other instance of the program can touch it.

Why this way? Because a program can check for the existence of a file even if not allowed to open that file.

Of course if the program (or the system) crashes before the program closes a file and deletes the lock a lock file can get left behind.

Michael D Novack
_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to