Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the number of hardlinks

Is there some library function, or some other way, to get the hard link count of some file in Python?


1 Answers

Use st_nlink:

os.stat("foo.txt").st_nlink

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!