Product Documentation

FairCom DB 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 FairCom DB API SDK error code on failure.

See FairCom DB API Errors and Return Values for a complete listing of valid FairCom DB API 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