Enables advisory locking of part of an I/O file object’s associated file, blocking if necessary. Blocking is not available on Windows.
Use pos() before locking a file segment
to determine the current location of the file position indicator.
Reading or writing to a file causes the file position indicator
to move. Because unlockSeg() always unlocks a
file from the indicator’s current location, before calling unlockSeg(),
reposition the file position indicator to the position it was at
when you called lockSeg() so that you unlock
exactly the segment you locked.
An advisory lock does not prevent other users from reading and writing to the file segment. Call lockEnforceOn() before calling lockSeg() to place enforcement locking on the file segment and prevent other users from reading and writing to it. Enforcement locking is available only UNIX, and the file must not have “group” execute permissions.
lockSeg(log size);
Parameter |
Description |
---|---|
size |
Number of bytes to examine for a lock. |
Integer. Returns 1 for success, and 0 for failure.
Pointer to object |
Object |
---|---|
|
|
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |