increaseSuffix

emlib.filetools.increaseSuffix(filename)[source]

Given a filename, return a new filename with an increased suffix if the filename already has a suffix, or a suffix if it hasn’t

input

output

foo.txt

foo-01.txt

foo-01.txt

foo-02.txt

foo-2.txt

foo-03.txt

Return type:

str