Skip to content

Instantly share code, notes, and snippets.

@SenpaiSilver
Created April 18, 2016 11:24
Show Gist options
  • Save SenpaiSilver/a34928ca4856e61254438986f63d0cff to your computer and use it in GitHub Desktop.
Save SenpaiSilver/a34928ca4856e61254438986f63d0cff to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
PRECEDE="./precede_files/"
PSO2="./pso2_files/"
files = {}
total_size = 0
new_files = 0
for e in os.listdir(PRECEDE):
files[e] = [0, 0, 0]
files[e][0] = os.stat("%s%s" % (PRECEDE, e)).st_size
if (os.path.isfile("%s%s" % (PSO2, e))):
files[e][1] = os.stat("%s%s" % (PSO2, e)).st_size
files[e][2] = files[e][0] - files[e][1]
for key, val in files.items():
if (val[1] == 0):
print("New file: %s" % (key))
new_files += 1
total_size += val[2]
print("Total new files: %d" % (new_files))
print("Total size in bytes: %d B" % (total_size))
print("Total size in MB: %d MB" % ((total_size / 1024) / 1024))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment