Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>unlock a region of a low level file.</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Unlock a region of a low level file.
------------------------------------------------------------------------------

 Syntax

        GT_FUnLock(<nHandle>,<nOffset>,<nLength>) --> lUnLocked

 Arguments:

      <nHandle> is a numeric file handle.

      <nOffset> is the byte position at which the unlock will start. This
                is a zero based value.

      <nLength> is the length of the region to unlock.

 Returns:

      A logical value, .T. if the region was unlocked, .F. if not.

 Description:

      GT_FUnLock() can be used to unlock a region of a low level file
      that has been locked withg GT_FLock().

      To use the low-level locking/un-locking functions you will first
      need to open the file with fopen(), or perhaps create a file with
      fcreate(). Once open you can use the file handle returned by
      Clipper to carry out a lock.


 Examples:


      #include "fileio.ch"

      if (nFile := fopen("LIFE.42",FO_SHARED)) != F_ERROR

         // Lock a region in the file at position 10 (don't forget,
         // the offset starts at 0, not 1!

         if GT_FLock(nFile,10,2)

            // Make some changes to the file.
              .
              .
              .
            // Now unlock the same region.

            GT_FUnLock(nFile,10,2)
         endif
         fclose(nFile)
      endif


 Source: LLFLOCK.C

 Author:  Dave Pearson

See Also: GT_FLOCK()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson