Shows how to use file objects.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wiredtiger.h>
static const char *home;
int
main(void)
{
int ret;
if (getenv("WIREDTIGER_HOME") == NULL) {
home = "WT_HOME";
ret = system("rm -rf WT_HOME && mkdir WT_HOME");
} else
home = NULL;
(ret = conn->
open_session(conn, NULL, NULL, &session)) != 0) {
fprintf(stderr, "Error connecting to %s: %s\n",
return (ret);
}
ret = session->
create(session,
"file:example",
"key_format=u,"
"internal_page_max=32KB,internal_item_max=1KB,"
"leaf_page_max=1MB,leaf_item_max=32KB");
return (conn->
close(conn, NULL) == 0 ? ret : EXIT_FAILURE);
}