Locking the FileUse a LockType argument value to specify the operations permitted on the open file by other processes. This parameter is useful when writing network applications. You can restrict access to a file so that only one user at a time has access to the file or can write to the file. This helps prevent two users from trying to make changes at the same time (which would inevitably result in losing the changes one of the users made). The valid options for LockType are Shared, Lock Read, Lock Write, and Lock Read Write. Shared lets all users access the file simultaneously. Lock Read locks the file so that only the person with the file open for reading can access the file. Lock Write locks the file so that only the person who has the file open for write access can write to the file. Lock Read Write locks the file from all users except the one who has the file open for read and write access. |
|
![]() |
![]() |
|||