[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   XPflock()
   Lock binary files
------------------------------------------------------------------------------

   Function:   XPflock()

               XPflock() makes it possbile to issue locks to a
               specified region of a binary file. The file must be opened
               or created in shared mode (see fopen()).

               Take great care when using this function. As QUITting the
               applic with locks set has undefined results. Also, you
               yourself have to Unlock the exact same region of the file,
               so you need to keep track of the locks set. There is no
               restriction on the number of locks you can set.

               Also note that the Clipper locking system on .DBF files
               is not at all how it is implemented in DOS, as locking
               a region using XPflock() is more or less
               equivalent to locking exclusive in Clipper, one
               can't even read from it anymore. Clipper locks
               bytes after the Eof() position for rlock() and
               flock(), which CAN be implemented with this function,
               but it's not recommended..

               Resuming: Know what you do when you use these functions in a
               real-time environment!

   Syntax:     XPflock(h,nOffset,nLength) --> NIL

   Arguments:  <h> is the file's handle. <nOffset> is the offset
               where the lock starts, <nLength> is the length of the region
               to lock. Note that the lock is exclusive, others users
               cannot read nor write to that region!

   Returns:    NIL, see XPferror() for results. eg. 33 indicates region
               is already locked, 6 indicates invalid handle.

   Usage:      

See Also: XPferror() XPfunlock()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson