How does folder locking work?
Locks are used by Pine and other mail programs to prevent damage from occurring to the mail file when multiple programs try to write to the file at the same time. Because there are many different schemes of mail file locking used on UNIX, Pine implements all of them. The result is a lot of complexity. There are several reasons why locking needs to be done: • If you want to read the mail file, you want to make sure that no other process will modify the mail file while you are reading it. • If you want to write to the mail file, you want to make sure that no other process is accessing the mail file while you are writing it. • If you have the mail file open, you want to make sure that no other process can alter any of the internal contents of the mail file that you have read, but it is OK if another process appends new data to the mail file. • If you want to alter any of the internal contents of the mail file, you want to make sure that no other process has the mail file open. There are s