>>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,
>
>I am sure it is that or some other function of the OS file system that is being used. VFP does not hold the actual locks for any of them, they are all (file, record, and exclusive) held at the OS level otherwise the locks could not be seen from different work stations. I know the VFP file and record locks are semiphores because for a long time there were problems with Fox and Clipper in that they did not respect each others locks.
JimB,
No argument there. There is, however, a difference, that I believe should be acknowledged, between exclusive use of a file, and locking a record or header.
Semaphores are just what the name implies: a signal. Now when VFP opens a file in exclusive mode, it simply uses CreateFile(), passing 0 as the dwShareMode parameter. By doing this no other process can get a handle to the file.
In shared mode, however, another process can get a handle to it. I won't go into deal about it (like Ed probably would< g >) This is where semaphores come in and the OS still is in charge of co-ordinating things like record lock via semaphores. If a record is locked, by another process, VFP doesn't raise an error. By contrast, with exclusive use, it does.
George
Ubi caritas et amor, deus ibi est