Exclusive Access Control
When you text in a file, Qedit creates a workfile and copies the contents of the original file into it. The original file is then closed. This means that other users on the system can text in the file and make changes of their own. This is great for concurrency but not so great for version control.
A new option, Set Text Exclusive, provides increased control over files that you are editing. To enable, simply enter:
/Set Text Exclusive On
When this option is enabled, files that you text in are kept open for read-only access. This means the files are still accessible to compilers and other programs with non-conflicting access including Qedit with Set Text Exclusive disabled. In the latter case, a user will be able to text the file in but will not be able to save changes with a Keep command. When Set Text Exclusive is enabled, a user requires read and write permissions to be able to Text in a file. If he only has read permission, he has to use the Browse option on the Text command even if the file is not currently accessed.
Once Set Text Exclusive is enabled for all users and a particular file is being worked on, subsequent Text commands immediately fail with:
Error: File open by another Qedit process
On a system where Qedit is the editor of choice, we recommend that Set Text Exclusive be inserted in the /opt/robelle/qeditmgr file.
Once a file has been texted in, the user retains control over it. The file is released when:
- another file is texted in
- the workfile is closed explicitly by a Shut command or implicitly by a New or Open command
- the workfile is purged e.g. purge *
- Qedit is terminated
All these operations signal Qedit that the work is done on this file. When the workfile is shut (explicitly or implicitly), Qedit tries to clear its contents. If the file is clean (i.e., has not been modified), the file is erased. If the file has been modified, Qedit prompts for a confirmation:
/shut
Reminder: you have not saved the changes to /home/bob/testisql.c
/var/tmp/qscr.CAAa09829
Clear file [no]?
If you answer No, nothing happens. The workfile remains open, the original file is still in use and a warning is displayed.
File NOT cleared
Files still open. When Text Exclusive is On, workfile must be cleared to Shut.
If you answer Yes, the workfile is cleared and the original file is released. This accomplishes two things:
- releases the file so it can be used by someone else and does not remain blocked
- forces the user to stop and decide what should be done with the changes
- forces the user to text the file in again to make sure he has the latest version