Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Section 'Locking Data' in the VFP7 Help
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Miscellaneous
Thread ID:
00693991
Message ID:
00694173
Views:
18
>Jim,
>
>>I would certainly agree with you if I was sure of exactly what a "file lock" is. My GUESS on the subject is that a "file lock" is a totally different mechanism than a record lock and that there is a good likelihood that it is the same mechanism that the operating system (file system) uses across all applications when it wants to prevent access of the file by others.
>>Can you please clarify the situation?
>
>A file lock is similar to having a record lock on all the records simultaneously. A file lock prevents any one from getting a file lock or record lock on any record within the table. It does not prevent others from opening the table or reading the data, also one can obtain a file lock even if others have the table open as long as they have no record locks or file lock. Whereas EXSCLUSIVE use prevents anyone from opening the table and is denied if anyone has the table open.
>
>As to the exact mechanism VFP uses to secure these types of locks I don't know the details except that the locks (file and record locks are actually semiphore locks as VFP is locking a location on the disk that is offset from the actual location of the record or file (this offset is one of the reasons for the 2 GB limit on file size). I believe that exclusive use is accomplished by requesting esxclusive access from the OS.

JimB,

In all likelihood VFP opens the table via the CreateFile() function passing zero for the dwShareMode parameter. From the Platform SDK:

If dwShareMode is zero and CreateFile succeeds, the object cannot be shared and cannot be opened again until the handle is closed.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform