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