Monday, 21 October 2019

Python shutil module move exception handling

Destination path /tmp/abc in both Process 1 & Process 2 Say there are N number of process running we need to retain the file generated by the latest one

Process1

import shutil
shutil.move(src_path, destination_path)

Process 2

import os
os.remove(destination_path)

Solution 1. Handle the process saying if copy fails with [ErrNo2]No Such File or Directory

Is this the correct solution? Is there a better way to handle this



from Python shutil module move exception handling

No comments:

Post a Comment