get full route executable controlling slight hpux
i wish full route controlling slight (executable) but carrying bottom assent controlling c++ code. someone advise proceed grasp this.
on linux platforms i controlling following way.
char exepath[1024] = {0};
char procid[1024] = {0};
char exelink[1024] = {0};
sprintf(procid, "%u", getpid());
strcpy(exelink, "/proc/");
strcat(exelink, procid);
strcat(exelink, "/exe");
readlink(exelink, exepath, sizeof(exepath));
here exepath gives us full route executable.
similarly windows controlling
getmodulefilename(null, exepath, sizeof(exepath)); /* fullpath use */
please assistance me hp-ux given there /proc office hp-ux.
Comments
Post a Comment