How to know when you are in a symbolic link
<p>How to know, in Python, that the directory you are in is inside a symbolic link ?</p>

<p>I have a directory <strong>/tmp/foo/kiwi</strong></p>

<p>I create a symlink <strong>/tmp/bar</strong> pointing to <strong>/tmp/foo</strong></p>

<p>I enter into <strong>/tmp/bar/kiwi</strong></p>

<p>the linux command <strong>pwd</strong> tells me I'm in <strong>/tmp/bar/kiwi</strong>, which is correct.</p>

<p>The python command prompt tells me I'm in <strong>/tmp/foo/kiwi</strong>:</p>

<pre><code>Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import os
&gt;&gt;&gt; os.getcwd()
'/tmp/foo/kiwi'
</code></pre>

<p>Is there a way, in Python, to get the directory I'm really in ?</p>
