xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

BlobRootLock()

Places a lock on the root area of a BLOB file.

Syntax

BlobRootLock() --> lSuccess

Return

The return value is .T. (true) if the root area is successfully locked, otherwise .F. (false) is returned.

Description

BlobRootLock() is the only function that can place a lock on the root area of a BLOB file. A lock is required to avoid concurrency conflicts when a BLOB file is open in SHARED mode. It must be released later with BlobRootUnlock().

Note:  the file Blob.ch must be #included for BlobRootLock() to work.

Info

See also:BlobRootGet(), BlobRootPut(), BlobRootUnlock()
Category: Blob functions , Database functions
Header:blob.ch
Source:rdd\dbcmd.c, rdd\dbffpt\dbffpt1.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates the coding pattern that must be used to
// read the root area of a shared BLOB file.

   #include "Blob.ch"

   REQUEST DBFCDX

   PROCEDURE Main
      LOCAL xBlobRoot

      USE PhotoArchive ALIAS Photos VIA "DBFCDX" SHARED

      IF BlobRootLock()
         xBlobRoot := BlobRootGet()
         BlobRootUnlock()
         ? Valtype( xBlobRoot )
      ELSE
         Alert( "Unable to lock the root area" )
      ENDIF

      USE
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe