Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbSetPathPrefix

Set the client-side path prefix.

Declaration

CTDBRET ctdbSetPathPrefix(CTHANDLE hSession, pTEXT pathPrefix);

Description

A path prefix can be set anytime after the session handle is allocated. If a path prefix is set before a session logon, the new path prefix will affect the location of the session dictionary file. If a path prefix is set after a session logon, but before a database connect, then the path prefix affects only the database dictionary and any tables that are manipulated during that session.

A path prefix can be removed at any time by setting a NULL value for the path prefix. You can use ctdbGetPathPrefix() to check if a path prefix is set or not. If ctdbGetPathPrefix() returns NULL, then no path prefix is set.

Return

Value

Symbolic Constant

Explanation

0

CTDBRET_OK

ctdbSetPathPrefix() returns CTDBRET_OK on success or c-treeDB SDK error code on failure.

See c-treeDB Errors and Return Values for a complete listing of valid c-treeDB error codes and return values.

Example


/* set the current path prefix */

if (ctdbSetPathPrefix(AnyHandle, "c:\myDirectory") != CTDBRET_OK)

printf("ctdbSetPathPrefix() failed\n");


/* clear the current path prefix */

if (ctdbSetPathPrefix(AnyHandle, NULL) != CTDBRET_OK)

printf("ctdbSetPathPrefix() failed\n");

See also

ctdbGetPathPrefix()

TOCIndex