kv_lob_put_from_file()

#include <kvstore.h>

kv_error_t
kv_lob_put_from_file(kv_lob_handle_t *handle,
                     const char *path_to_file); 

Writes the Large Object stored in path_to_file to the store. The key used for the resulting record is the key that was used to create the kv_lob_handle_t (using kv_lob_get_for_write()). The handle must have been open for writing, or KV_INVALID_ARGUMENT is returned.

If the put is successful, KV_SUCCESS is returned.

The object is written to the store in chunks. Each chunk must be written to the store within the timeout period defined when the kv_lob_handle_t was created, or the put will fail.

When the handle is created, it is possible to specify restrictions on the write depending on whether the LOB currently exists in the store (using the if_presence parameter for kv_lob_get_for_write()). If KV_IF_PRESENT was specified and the key does not exist, KV_KEY_NOT_FOUND is returned. If KV_IF_ABSENT was specified and the key exists, KV_KEY_EXISTS is returned.

Parameters

  • handle

    The handle parameter is the handle to the store where you want to write the LOB.

  • path_to_file

    The path_to_file parameter is the filesystem path to the file that contains the LOB value that you want to write to the store.