# EssGetLocalPath

Description

EssGetLocalPath() gets the full local file path for a specific object file on the client.

Syntax

    ESS_FUNC_M EssGetLocalPath (hCtx, ObjType, AppName, DbName, ObjName, Create, pPath);

ESS_HCTX_T | hCtx
ESS_OBJTYPE_T | ObjType
ESS_STR_T | AppName
ESS_STR_T | DbName
ESS_STR_T | ObjName
ESS_BOOL_T | Create
ESS_PSTR_T | pPath

Parameters

hCtx | Essbase API context handle returned by EssCreateLocalContext()
ObjType | Object type (must be single type). Object types are listed in Bitmask Data Types.
AppName | Application name or NULL (ESS_NULL). If NULL, command assumes a file name, and EssGetLocalPath() returns the ObjName in pPath as is.
DbName | Database name. If NULL, uses the application subdirectory.
ObjName | Object name or file name if AppName is NULL ObjName is not parsed for correctness; no suffix is appended to the path.
Create | Create directories flag. If TRUE, the appropriate application and database sub-directories will be created if necessary. If FALSE, and the directories do not exist, an error will be generated.
pPath | Address of pointer to receive allocated local path name string

Return Value

If successful, returns the full path name of the appropriate object file in pPath.

Notes

- The memory allocated for pPath should be freed using EssFree().

Access

This function requires no special privileges.

Example

    ESS_VOID_T
    ESS_GetLocalPath (ESS_HINST_T hInst)
    {
       ESS_FUNC_M         sts = ESS_STS_NOERR;
       ESS_HCTX_T        hLocalCtx;
       ESS_STR_T         AppName;
       ESS_STR_T         DbName;
       ESS_STR_T         ObjName;
       ESS_OBJTYPE_T     ObjType;
       ESS_BOOL_T        Create;
       ESS_STR_T         Path;

       AppName = "Sample";
       DbName  = "Basic";
       ObjName = "Basic";
       ObjType = ESS_OBJTYPE_OUTLINE;
       Create  = ESS_TRUE;
       sts = EssCreateLocalContext(hInst, NULL, NULL,
            &hLocalCtx);
       if(!sts && hLocalCtx)
       {
          sts = EssGetLocalPath(hLocalCtx, ObjType,
             AppName, DbName, ObjName, Create, &Path);
          if(!sts)
          {
             if(*Path)
             {
                printf("Path: %s\r\n",Path);
                EssFree(hInst,Path);
             }
          }
       }

       if(hLocalCtx)
          sts = EssDeleteLocalContext(hLocalCtx);
    }

See Also

EssCreateLocalContext()
EssListObjects()