prevent_overwrite¶
-
imagepypelines.
prevent_overwrite
(filename, create_file=False)[source]¶ checks to see if a file or directory already exists and creates a new filename if it does. It can also create the file if specificed
when creating a file, this function assumes that if there is no file extension then it should create a directory
Note
This function creates unique filenames by creating them and checking their current existence. THIS CAN BE A SLOW PROCESS – it is much more efficient to keep track of filenames internally in your application