Static void Lock(int FileNumber, long FromRecord, long ToRecord) public static void Lock (int FileNumber, long FromRecord, long ToRecord) The My feature gives you better productivity and performance in file I/O operations than Lock and Unlock.
Lock and Unlock functions are always used in pairs. The Lock and Unlock functions are used in environments where several processes might need access to the same file. Sub PutInLockedFile(ByVal onePerson As Person)įileOpen(1, "c:\people.txt", OpenMode.Binary) This example assumes that People.txt is a file that contains records of the structure Person.
This example illustrates the use of the Lock and Unlock functions. In this article Overloads Lock(Int32)Ĭontrols access by other processes to all or part of a file opened by using the Open function. Controls access by other processes to all or part of a file opened by using the Open function.