Message188478
size = 0
for name, st in scandir(path):
if st.st_mode is None or st.st_size is None:
st = os.stat(os.path.join(path, name))
if stat.S_ISREG(st.st_mode):
size += st.st_size
It would be safer to use dir_fd parameter when supported, but I don't
think that os.scandir() should care of this problem. An higher level
API like pathlib, walkdir & cie which should be able to reuse *at() C
functions using dir_fd parameter. |
|
Date |
User |
Action |
Args |
2013-05-05 23:16:39 | vstinner | set | recipients:
+ vstinner, loewis, twouters, rhettinger, terry.reedy, gregory.p.smith, ncoghlan, pitrou, giampaolo.rodola, christian.heimes, tim.golden, eric.araujo, Trundle, brian.curtin, benhoyt, torsten, nvetoshkin, neologix, abacabadabacaba, socketpair, serhiy.storchaka |
2013-05-05 23:16:39 | vstinner | link | issue11406 messages |
2013-05-05 23:16:39 | vstinner | create | |
|