Popular recipes tagged "rename" and "name"http://code.activestate.com/recipes/tags/rename+name/2010-04-18T21:07:52-07:00ActiveState Code RecipesMake unique file name (Python)
2010-04-18T21:07:52-07:00Denis Barmenkovhttp://code.activestate.com/recipes/users/57155/http://code.activestate.com/recipes/577200-make-unique-file-name/
<p style="color: grey">
Python
recipe 577200
by <a href="/recipes/users/57155/">Denis Barmenkov</a>
(<a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/name/">name</a>, <a href="/recipes/tags/rename/">rename</a>).
Revision 2.
</p>
<p>Sometimes it is important to save data in the file but the file with the specified name already exists. This function creates a file name that is similar to the original by adding a unique numeric suffix. This avoids the renaming of existing files.</p>