wait to the file is closed before to remove (Windows)
parent
0ff9facb54
commit
a625c95f34
|
@ -204,7 +204,13 @@ class MunyalClient(Icon):
|
|||
f.write(base64.b85decode(data["file"].encode("ascii")))
|
||||
os.rename(temp_dir, full_path)
|
||||
else:
|
||||
while True:
|
||||
try:
|
||||
os.remove(full_path)
|
||||
break
|
||||
except:
|
||||
print("Maybe the file is open, please close first")
|
||||
sleep(5)
|
||||
else:
|
||||
if data["action"] == "add":
|
||||
os.mkdir(full_path)
|
||||
|
|
Loading…
Reference in New Issue