xHarbour Reference Documentation > Function Reference |
Stores data in the root area of a BLOB file.
BlobRootPut( <xBlobData> ) --> lSuccess
The return value is .T. (true) if the data is successfully written to the root area of a BLOB file, otherwise .F. (false) is returned.
BlobRootPut() is used to store data in the root area of a BLOB file. The root area is a unique storage place within a BLOB file that is only accessible with the functions BlobRootGet() and BlobRootPut().
When the BLOB file is open in SHARED mode, function BlobRootLock() must be called to avoid conflicts in concurrent file access. This is the only function that places a lock on the root area of a BLOB file.
Note: the file Blob.ch must be #included for BlobRootPut() to work.
See also: | BlobRootDelete(), BlobRootGet(), BlobRootLock() |
Category: | Blob functions , Database functions |
Header: | blob.ch |
Source: | rdd\dbcmd.c, rdd\dbffpt\dbffpt1.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// This example creates a stand alone DBV file and stores the BLOB IDs // in the root area of the BLOB file. #include "Blob.ch" REQUEST DBFBLOB PROCEDURE Main LOCAL aFile LOCAL aFiles := Directory( "*.jpg" ) LOCAL aBlobID := {} DbCreate( "ImageArchive", {}, "DBFBLOB" ) USE ImageArchive NEW VIA "DBFBLOB" FOR EACH aFile IN aFiles AAdd( aBlobID, BlobDirectImport( 0, aFile[1] ) ) NEXT IF BlobRootLock() .AND. BlobRootPut( aBlobID ) BlobRootUnlock() ELSE Alert( "Unable to lock BLOB root;try again later" ) ENDIF USE RETURN
http://www.xHarbour.com