On Tue, 2006-05-16 at 03:52 +0200, Udo Richter wrote:
Stefan Lucke wrote:
Is it possible to get acces to the path name specified with -L option ?
vdr -L SEARCH_PATH -P "softdevice -L OTHER_SEARCH_PATH"
So in case these paths are the same, it would be nice to drop one argument for softdevice.
cPluginManager::directory. Unfortunately this is private. There's currently no way to get access to it without dirty tricks. (see proxy plugin on how to do it anyway ;) )
Or try something like:
char *GetLibPath(void) { Dl_info info; char *libpath, *pt; static int my_marker = 0;
if(!dladdr((void *)&my_marker, &info)) { printf("Error: dladdr() returned false (%s)", dlerror()); return NULL; } printf("Plugin file is %s", info.dli_fname);
libpath = strdup(info.dli_fname); if(NULL != (pt=strrchr(libpath, '/'))) *(pt+1) = 0;
printf("Plugin path is %s", libpath); return libpath; }
- Petri