Message275293
os.stat(file).st_nlink gives 1 but same file's st_nlink from os.scandir(dir) gives 0.
"""
Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()
Platform: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
"""
import os
import os.path
print('os.stat:', os.stat(__file__).st_nlink)
for entry in os.scandir(os.path.dirname(os.path.abspath(__file__))):
if entry.name == 'stat.py':
print('os.scandir:', entry.stat().st_nlink)
"""
os.stat: 1
os.scandir: 0
""" |
|
Date |
User |
Action |
Args |
2016-09-09 09:24:54 | Mohanson Leaf | set | recipients:
+ Mohanson Leaf, paul.moore, tim.golden, zach.ware, steve.dower |
2016-09-09 09:24:54 | Mohanson Leaf | set | messageid: <1473413094.07.0.556978499762.issue28041@psf.upfronthosting.co.za> |
2016-09-09 09:24:54 | Mohanson Leaf | link | issue28041 messages |
2016-09-09 09:24:53 | Mohanson Leaf | create | |
|