In python, how do I get modification date of a symlink, not the file it points to?
I am using Python 2.7 on Ubuntu.
Thanks.
Use the os.lstat()
call; it works just like os.stat()
but doesn't follow symlinks:
import os
modification_time = os.lstat(path_to_symlink).st_mtime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With