For a file-system comparison tool in Python I want to find out what the link text of a symbol link is. I do not want to follow the link, bur rather find the link text and whether it is absolute or relative.
Example: For a link which via ls -l
prints
lrwxr-xr-x 1 tutor staff 16B 25 Aug 17:13 etc -> dir-with-dir/etc
I would like to retrieve the text "dir-with-dir/etc" exactly in this relative form.
How can I access this information in Python?