Coder's Guild Mailing List

how to get the dir of an app

Posted by jason on 2000-04-02

anyone know how to get the absolute dir of an app that you call. 

ie, i'm in my dir ~jason and i call ls.  how would get the directory ls is in.

basically what i'm doing is, somebody calls my app which goes back 1 dir from
its position and then into another dir.  so if the app fubar is in
/usr/bin/ then when it executes it will change the dir to /usr/fubar

any clues hints or suggestions?
Sponsored by Wrox Press - www.wrox.com. Programmer to Programmer (TM)
To signoff send a mail to listserver@xxxx.xx.xx with 
  "signoff tcg" in the body of your message.