Return a replacement path if input path is currently in use.
Enumerates until an unused filename is found, e.g., “foo.fits” becomes
“foo.0.fits”, if that is used, “foo.1.fits” and so on.
- Parameters:
path (str
) – A string path.
- Returns:
str
– A string path.