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_ThCtx
ESS_OBJTYPE_TObjType
ESS_STR_TAppName
ESS_STR_TDbName
ESS_STR_TObjName
ESS_BOOL_TCreate
ESS_PSTR_TpPath

Parameters

hCtxEssbase API context handle returned by EssCreateLocalContext()
ObjTypeObject type (must be single type). Object types are listed in Bitmask Data Types.
AppNameApplication name or NULL (ESS_NULL). If NULL, command assumes a file name, and EssGetLocalPath() returns the ObjName in pPath as is.
DbNameDatabase name. If NULL, uses the application subdirectory.
ObjNameObject name or file name if AppName is NULL ObjName is not parsed for correctness; no suffix is appended to the path.
CreateCreate 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.
pPathAddress 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

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()