Commit 7ad56750 authored by 张彦钊's avatar 张彦钊

add prints for test

parent 995359da
...@@ -8,12 +8,14 @@ import time ...@@ -8,12 +8,14 @@ import time
# 定期删除特定文件夹内特征的文件 # 定期删除特定文件夹内特征的文件
def remove_files(fileDir): def remove_files(fileDir):
print("test1")
for eachFile in os.listdir(fileDir): for eachFile in os.listdir(fileDir):
if (os.path.isfile(fileDir + "/" + eachFile)) and ("DiaryTop3000.csv" in eachFile): if (os.path.isfile(fileDir + "/" + eachFile)) and ("DiaryTop3000.csv" in eachFile):
ft = os.stat(fileDir + "/" + eachFile) ft = os.stat(fileDir + "/" + eachFile)
ltime = int(ft.st_mtime) ltime = int(ft.st_mtime)
# 删除5分钟前的文件 # 删除5分钟前的文件
ntime = int(time.time()) - 5*60 ntime = int(time.time()) - 5*60
print("test2")
if ltime <= ntime: if ltime <= ntime:
os.remove(fileDir + "/" + eachFile) os.remove(fileDir + "/" + eachFile)
print("成功删除临时csv文件") print("成功删除临时csv文件")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment