when i give
ls -l /etc/fonts/conf.d/70-yes-bitmaps.conf
lrwxrwxrwx <snip> /etc/fonts/conf.d/70-yes-bitmaps.conf -> ../conf.avail/70-yes-bitmaps.conf
so for a symbolic link or soft link, how to find the target file's full(absolute path) in python,
If i use
os.readlink('/etc/fonts/conf.d/70-yes-bitmaps.conf')
it outputs
../conf.avail/70-yes-bitmaps.conf
but i need the absolute path not the relative path, so my desired output must be,
/etc/fonts/conf.avail/70-yes-bitmaps.conf
how to replace the ..
with the actual full path of the parent directory of the symbolic link or soft link file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…