How can I get path/name of the softlink to my python script when executing it

Pascal Chambon chambon.pascal at wanadoo.fr
Sun Apr 19 17:35:31 EDT 2009


Hello

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...

Have you tried typing "python ./waf", to see how the resolution occurs 
in that case ?

Regards,
Pascal



Saravanan Shanmugham (sarvi) a écrit :
>  
> Hi,
>     I am writiing a script say "wabexec" in python
>     I will then have softlinks from other softlinks like  ls, 
> waf,hello, etc that are in the same directory and pointing to wabexec.
>  
> 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.
>  
> both __file__ and sys.arg0[] seem to have wabexec not the name of the 
> softlink.
>  
> Any ideas?
>  
> Sarvi
> ------------------------------------------------------------------------
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090419/fa55a405/attachment.html>


More information about the Python-list mailing list