mirror of
https://github.com/xzb23/check_duplicate_files.git
synced 2026-11-22 01:04:40 +08:00
add 占用统计
This commit is contained in:
1 file changed
+14
-4
@@ -32,15 +32,25 @@ def hash_files_from_glist(algorithm: function):
|
||||
|
||||
|
||||
def print_info(hash_to_files_list: list = runing_data.hash_to_files):
|
||||
size_total = 0
|
||||
size_if_one = 0
|
||||
print_size_total = 0
|
||||
print_size_if_one = 0
|
||||
for t in runing_data.hash_to_files:
|
||||
st_size = os.stat(runing_data.hash_to_files[t][0]).st_size
|
||||
size_total += st_size * len(runing_data.hash_to_files[t])
|
||||
size_if_one += st_size
|
||||
if st_size <= config.flag_size:
|
||||
continue
|
||||
print_size_total += st_size * len(runing_data.hash_to_files[t])
|
||||
print_size_if_one += st_size
|
||||
if len(runing_data.hash_to_files[t]) > 1:
|
||||
st_size = os.stat(runing_data.hash_to_files[t][0]).st_size
|
||||
if st_size <= config.flag_size:
|
||||
continue
|
||||
print(t, f"size: {st_size} Byte")
|
||||
for fp in runing_data.hash_to_files[t]:
|
||||
print("\t", fp)
|
||||
print()
|
||||
print()
|
||||
print(f"重复部分占用/总占用:\t{(size_total-size_if_one)//1024}KiB / {size_total//1024}KiB")
|
||||
print(f"占用大于 {config.flag_size} Byte 的文件中,重复部分占用/总占用:\t{(print_size_total-print_size_if_one)//1024}Kib / {print_size_total//1024}KiB")
|
||||
|
||||
|
||||
def reg_opts():
|
||||
|
||||
Reference in new issue
Block a user