python - Get file size during os.walk -


i using os.walk compare 2 folders, , see if contain exact same files. however, checks file names. want ensure file sizes same, , if they're different report back. can file size os.walk?

the same way file size without using os.walk, os.stat. need remember join root:

for root, dirs, files in os.walk(some_directory):     fn in files:         path = os.path.join(root, fn)         size = os.stat(path).st_size # in bytes          # ... 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -