简体   繁体   中英

How can I get size of symbolic link in python

let's assume: file ln -s file s_file

os.path.getsize(s_file) or os.stat(s_file).st_size 

will return size of real file. I want only s_file. How can I do it ?

特定于符号链接的os.lstat是否适合您?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM