Administration

File locking

When you edit a file, you perform at least three actions on that file -- you open the file in your editing program, you make changes, and finally you save the file.

Imagine that two people want to edit the same file. The first person opens the file in an editor and starts making changes. Then the second person opens the file, makes changes, and saves the file before the first person has finished editing. Later, the first person finishes editing the first copy of the file and saves it.

The second person's changes are lost because they weren't in the file when the first person started editing. Ideally, the second person should have been prevented from editing the file until the first person had finished.

The process of controlling which actions users are allowed to perform on a file while another user is performing an action on a file is called file locking.

For example, if you're reading a file but don't intend to make changes, it might be acceptable for others to read the same file. However, it might not be acceptable for others to modify the file while you're reading it.

File locking lets users be sure that files they work with are up-to-date, and that all their changes will be preserved.


© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999