AnsweredAssumed Answered

Python help- changing output file name if name already exists

Question asked by t.faull on Mar 24, 2017
Latest reply on Mar 27, 2017 by t.faull

Hi guys and gals,

I have a script which exports a shapefile to a folder. The output file name is 'Properties.shp'. This file is contasntly accessed by a server machine, therefore it has a LOCK file on it.

 

When I run the script for a second time, it often fails because it detects that and older version of 'Properties.shp' is already sitting in the folder. So when I update this file I have to manually ammend the script to write 'Properties2.shp' as the new output file name to avoid a clash.

 

Any ideas of how I can get around this? The overwrite = true function won't work as a LOCK file prevents this.

What I want is for the script to rename the output file 'Properties[current_date].shp'

Outcomes