<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3492" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009>Sorry. I should have responded earlier to close this 
thread. It was my programming error.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009>Both sys.argv[0] and __file__ do point to the name and 
path of the softlink and not the actual program it is linked 
to.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009>So. Soryy. My bad programming got in my 
way.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=312195421-19042009>Sarvi</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Pascal Chambon 
[mailto:chambon.pascal@wanadoo.fr] <BR><B>Sent:</B> Sunday, April 19, 2009 2:36 
PM<BR><B>To:</B> Saravanan Shanmugham (sarvi)<BR><B>Cc:</B> 
python-list@python.org<BR><B>Subject:</B> Re: How can I get path/name of the 
softlink to my python script when executing it<BR><B>Importance:</B> 
High<BR></FONT><BR></DIV>
<DIV></DIV>Hello<BR><BR>I fear that in this case the whole indirection 
operations on softlink occur only in the shell, and that the final command is 
only executed as if it were called directly on the real file...<BR><BR>Have you 
tried typing "python ./waf", to see how the resolution occurs in that case 
?<BR><BR>Regards, <BR>Pascal<BR><BR><BR><BR>Saravanan Shanmugham (sarvi) a 
écrit : 
<BLOCKQUOTE 
cite=mid:C6A1C20DB743364EB446E923B2229FEF085F3C5C@xmb-sjc-229.amer.cisco.com 
type="cite">
  <META content="MSHTML 6.00.2900.3492" name=GENERATOR>
  <DIV> </DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial 
  size=2>Hi,</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial size=2>    
  I am writiing a script say "wabexec" in python</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial size=2>    
  I will then have softlinks from other softlinks like  ls, waf,hello, etc 
  that are in the same directory and pointing to wabexec.</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009></SPAN> </DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial size=2>When some executes 
  ./waf or ./hello and wabexec gets invoked because of the softlink, how do I 
  find out from within wabexec how it was invoked? was it throug waf or hello, 
  etc.</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009></SPAN> </DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial size=2>both __file__ and 
  sys.arg0[] seem to have wabexec not the name of the 
  softlink.</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009></SPAN> </DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial size=2>Any 
  ideas?</FONT></SPAN></DIV>
  <DIV><SPAN class=781421719-19042009></SPAN> </DIV>
  <DIV><SPAN class=781421719-19042009><FONT face=Arial 
  size=2>Sarvi</FONT></SPAN></DIV><PRE wrap=""><HR width="90%" SIZE=4>
--
<A class=moz-txt-link-freetext href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</A>
  </PRE></BLOCKQUOTE><BR></BODY></HTML>