Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7a54891f436ab824308d0f415dfc74288cf5cd45
Ticket: 1224888fffffffffffffffffffffffffffffffff
possible to have an empty info nameofexecutable
User & Date: dkf on 2011-10-12 16:49:56
Changes

  1. icomment:
    Doing a readlink() on /proc/[pid]/exe is elegant, but won't work on OSX. There, the only reliable method I've found for getting the executable path from the PID is by calling lsof in a subprocess:
    
      lsof -a -p [pid] -F n -d txt
    
    Then you need the first line that starts with 'n', and you need all of that line except the first character. Ugh. Works though. (Poking in the normal system process information doesn't work; that gives you the process name without the path to it.)
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"