[Tutor] os.listdir for symbolic links?

Lie Ryan lie.1296 at gmail.com
Wed Oct 27 21:48:06 CEST 2010


On 10/28/10 06:57, Sean Carolan wrote:
> Is there an easy way to find the target of a symbolic link on a Linux
> system with python?  I'm looking for something like the output of the
> bash command: "ls -l"

you're looking for

>>> os.path.realpath('/bin/uncompress')
'/bin/gunzip'



More information about the Tutor mailing list