The Concept of File Sharing and Locking is used in the Multi-users Environment, or in which there are many users those are Requesting for a Single File, to Perform Some Operations.
So that with the help of File Sharing Many users can perform the Operations on the Single File. But there must be Some Mechanism which is used for Controlling the Access onto the Single File.
File Locking is used when a Single User is Performing Operations on The file and other users can’t be able to change the contents of the File. So that there are three types of Lock:-
1) Read Only : This Lock is used when all the users are Reading the Contents from the Single File and no one can be able to Change the contents on the File.
2) Linked shared: The Linked Shared Locked is used when there are many users working on a Single file. And when the various users are requesting to change the contents of the File then the Changing will perform on the File by using some Linear Order.
3) Exclusive Lock: This is very important Lock and in this when the multiple users are working on the Single File. Then the File will be locked when any user is going to Change the data of the file, The Changing will be made by only the Single user and for the Other users Will be Locked.