You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
618 B
26 lines
618 B
from getFiles import get_file_list |
|
from getMd5 import get_file_md5 |
|
from db import * |
|
|
|
|
|
def main_process(): |
|
disk = "" |
|
cate = "" |
|
path = "" |
|
|
|
if disk == "" or cate == "" or path == "": |
|
print("检查参数") |
|
return |
|
|
|
file_list = get_file_list(path) |
|
for f in file_list: |
|
if md5 := get_md5_by_path(f): |
|
print(f"请注意!!!文件的md5({md5})已经存在: {f}") |
|
else: |
|
md5 = get_file_md5(f) |
|
insert_data((cate, disk, f, md5)) |
|
print(f"文件的md5({md5})成功插入: {f}") |
|
|
|
|
|
if __name__ == "__main__": |
|
main_process()
|
|
|