<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: retrieve absolute path from pid in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400735#M706232</link>
    <description>If I wont be able to retrieve the full pathname using "ps" then is there any system call and work around which will get me  abolsute path using pid.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Prakash.</description>
    <pubDate>Fri, 15 Oct 2004 07:24:49 GMT</pubDate>
    <dc:creator>Senthilprakash_1</dc:creator>
    <dc:date>2004-10-15T07:24:49Z</dc:date>
    <item>
      <title>retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400726#M706223</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I have the pid of the process. Using this pid i should retrieve the absolute path name of the executable. I tried pstat_getproc(), but it gives only the basename of the executable. I need the full path. Is there any system call available in HP-UX to do that or can i do this using scripting? &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Prakash.</description>
      <pubDate>Fri, 15 Oct 2004 02:29:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400726#M706223</guid>
      <dc:creator>Senthilprakash_1</dc:creator>
      <dc:date>2004-10-15T02:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400727#M706224</link>
      <description>Hi Prakash,&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -e -o ruser,pid,vsz,args&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Fri, 15 Oct 2004 02:45:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400727#M706224</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-10-15T02:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400728#M706225</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can user the "UNIX95" option&lt;BR /&gt;&lt;BR /&gt;eg&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -eo time,vsz,pid,args&lt;BR /&gt;&lt;BR /&gt;(see "columns" from man ps for more options)&lt;BR /&gt;and be aware of the " " before ps&lt;BR /&gt;This should give you what you want&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Franky</description>
      <pubDate>Fri, 15 Oct 2004 02:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400728#M706225</guid>
      <dc:creator>Franky_1</dc:creator>
      <dc:date>2004-10-15T02:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400729#M706226</link>
      <description>HI Prakash,&lt;BR /&gt;How about this one.&lt;BR /&gt;&lt;BR /&gt;# PIDNO=xxxx&lt;BR /&gt;# ps -ef | grep $PIDNO | grep -v grep | awk '{ print $9 }'&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 15 Oct 2004 02:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400729#M706226</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-10-15T02:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400730#M706227</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I invoke a executable ./a.out in /tmp/one.&lt;BR /&gt;Now i am in some different directory and try using the script provided i still get as &lt;BR /&gt;./a.out and not as /tmp/one/a.out.&lt;BR /&gt;&lt;BR /&gt;Prakash</description>
      <pubDate>Fri, 15 Oct 2004 03:02:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400730#M706227</guid>
      <dc:creator>Senthilprakash_1</dc:creator>
      <dc:date>2004-10-15T03:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400731#M706228</link>
      <description>you wont, the process is being started as ./a.out ( no full path )&lt;BR /&gt;&lt;BR /&gt;if you start is as # /tmp/one/a.out (without the .)the full path wil be visible in the ps list.</description>
      <pubDate>Fri, 15 Oct 2004 03:21:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400731#M706228</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-10-15T03:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400732#M706229</link>
      <description>I hope you are expecting full path and execution of a process there. We can do in linux using /proc filesystem. Every process ID contains exe part which gives link to exact execution path there.&lt;BR /&gt;&lt;BR /&gt;We can not get it using ps command there. We can get basename of execution, if we execute them as only that command. We can full path name when we does with full path name.&lt;BR /&gt;&lt;BR /&gt;You can go to glance tool, to know more about a process there. I am not sure which will give or not.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Fri, 15 Oct 2004 04:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400732#M706229</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-15T04:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400733#M706230</link>
      <description>You cann't get PATH from ps everytime. &lt;BR /&gt;&lt;BR /&gt;PATH output from ps is limited to 80 characters. If the PATH is longer you don't get it.&lt;BR /&gt;&lt;BR /&gt;I am curious if anybody know how to get full PATH.</description>
      <pubDate>Fri, 15 Oct 2004 04:31:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400733#M706230</guid>
      <dc:creator>Petr Simik_1</dc:creator>
      <dc:date>2004-10-15T04:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400734#M706231</link>
      <description>The full path is not stored in the process table unless the process is started with a full path (ie, starts with /). You can see the full path and the parameters (very common request for Java stuff) by using -x as in:&lt;BR /&gt; &lt;BR /&gt;ps -efx&lt;BR /&gt; &lt;BR /&gt;NOTE: -x is *only* available for patched versions of ps (11.00 and 11i only).</description>
      <pubDate>Fri, 15 Oct 2004 07:18:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400734#M706231</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-10-15T07:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400735#M706232</link>
      <description>If I wont be able to retrieve the full pathname using "ps" then is there any system call and work around which will get me  abolsute path using pid.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Prakash.</description>
      <pubDate>Fri, 15 Oct 2004 07:24:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400735#M706232</guid>
      <dc:creator>Senthilprakash_1</dc:creator>
      <dc:date>2004-10-15T07:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400736#M706233</link>
      <description>Finally Bill talked about option -x for ps command. You need to have ps patch for it. Else you can use UNIX95 command. Also as explained earlier by few memebers, if you started the progrm with absolute path, you will get it, else not.&lt;BR /&gt;&lt;BR /&gt;ps -efx|grep "xyz"&lt;BR /&gt;UNIX95= ps -ef -o "ruser,args,pid" | grep "xyz"&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 15 Oct 2004 07:27:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400736#M706233</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-15T07:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400737#M706234</link>
      <description>Bill said it all.  The full path is only stored if the process is started that way.&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2004 08:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400737#M706234</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-10-15T08:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400738#M706235</link>
      <description>i got the filename from the program below, on 11.00, 11.11 and 11.23.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;&lt;BR /&gt;int main (int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;  struct pst_vm_status vmstat;&lt;BR /&gt;  struct pst_filedetails psfdetails;&lt;BR /&gt;  char name[1024];&lt;BR /&gt;  int ret;&lt;BR /&gt;  int pid = atoi(argv[1]);&lt;BR /&gt;&lt;BR /&gt;  /* last parameter to getprocvm is 1  */&lt;BR /&gt;  /* because it worked :P will confirm */&lt;BR /&gt;  /* with vm folks later */&lt;BR /&gt;  if ((ret = pstat_getprocvm(&amp;amp;vmstat, sizeof(vmstat), pid, 1)) &amp;lt;0) {&lt;BR /&gt;    perror("pstat_getprocvm");&lt;BR /&gt;    exit(10);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  if ((ret=pstat_getfiledetails(&amp;amp;psfdetails, sizeof(psfdetails),&amp;amp;(vmstat.pst_fid))) &amp;lt;0) {&lt;BR /&gt;    perror("pstat_getfiledetails");&lt;BR /&gt;    exit(20);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  // printf ("device: %d, inode: %u\n", psfdetails.psfd_rdev, psfdetails.psfd_ino);&lt;BR /&gt;&lt;BR /&gt;  if ((ret=pstat_getpathname(name, 256, &amp;amp;(vmstat.pst_fid))) &amp;lt;0) {&lt;BR /&gt;    perror("pstat_getpathname");&lt;BR /&gt;    exit(30);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  puts(name);&lt;BR /&gt;}&lt;BR /&gt;---&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Fri, 15 Oct 2004 08:48:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400738#M706235</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2004-10-15T08:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400739#M706236</link>
      <description>oops i meant to say 11.11 and 11.23 but not on 11.00.</description>
      <pubDate>Fri, 15 Oct 2004 08:49:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400739#M706236</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2004-10-15T08:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400740#M706237</link>
      <description>Thanks, the program works :)</description>
      <pubDate>Fri, 15 Oct 2004 08:51:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400740#M706237</guid>
      <dc:creator>Senthilprakash_1</dc:creator>
      <dc:date>2004-10-15T08:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve absolute path from pid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400741#M706238</link>
      <description>&lt;BR /&gt;This is to track down the childs. &lt;BR /&gt;&lt;BR /&gt;Hope it helps..&lt;BR /&gt;&lt;BR /&gt;/bin/ps -ef | awk -v v=&lt;PID&gt; '  ($3 == v)  { print $2 } '&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;Prashant&lt;BR /&gt;&lt;/PID&gt;</description>
      <pubDate>Fri, 15 Oct 2004 09:35:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/retrieve-absolute-path-from-pid/m-p/3400741#M706238</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2004-10-15T09:35:37Z</dc:date>
    </item>
  </channel>
</rss>

