1

Is there any Python API available which supports creating a folder appended with increment number or unique character if the folder already exists?

e.g., In my directory BAR folder already exists. If I try to create a folder "BAR" it should create BAR1.

  • @mooga What I am looking for any existing Python module or library which also provide this support by passing a flag just like **exist_ok** flag is used to ignore the exception if already a folder exists with the name. pathlib.Path(path).mkdir(exist_ok=True) or os.makedirs(path, exist_ok=True) – Sachin Srivastava Feb 21 '19 at 11:57

0 Answers0