<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem - LOCK Files - Scripting in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100471#M3484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bugger...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh well...back to the ol' drawing board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for replying!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 12:56:16 GMT</pubDate>
    <dc:creator>KeaganAllan</dc:creator>
    <dc:date>2011-08-04T12:56:16Z</dc:date>
    <item>
      <title>Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100465#M3478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was looking for a work-around for a problem I am having with regards to a script I am developing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At the moment, I create a temp file, from which I perform the various geoprocessing tasks. This works out fine, until I have to restart the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This temp file needs to be deleted, so that if a user wishes to run the script at a new location they can. In ArcMap 9.3 and VBA I was able to use the "Kill("C:\test.*")" which would then delete all trace of that file so that everything could run again, without the fear of something being overwritten and causing an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcMap 10 and in VB.Net, there is a LOCK file which prevents this shapefile from being deleted - even if it is removed from the active ArcMap session. Now I do not want to have to shut down and restart ArcMap for each iteration of this script. Is there a way to stop the LOCK file from being generated, or is there a way to release the file from the cache?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;K&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jul 2011 11:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100465#M3478</guid>
      <dc:creator>KeaganAllan</dc:creator>
      <dc:date>2011-07-05T11:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100466#M3479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume you are creating a "temp"&amp;nbsp; by using MakeFeautreLayer or MakeTableView.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.x, you often have to delete that "temp" before the next iteration by using Delete_managment() or you'll get a lock error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 11:43:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100466#M3479</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2011-07-06T11:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100467#M3480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you could possibly tell, your suggention worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I created the add-in and it worked great with regards to deleting the temp file on each iteration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have since moved onto my next project - almost identical - and I am getting into the same problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the "GP.Execute("delete_management", parameters, Nothing)" to delete the temp file that was generated on the first iteration. This removes all trace (except for two LOCK files?). When i then try and intersect the temp file with another, it bombs Arcmap and I have to re-open the mxd and load the add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously once Arcmap crashes the LOCK is gone and the script can be re-run, this is not acceptable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any other solution to this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;K&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 11:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100467#M3480</guid>
      <dc:creator>KeaganAllan</dc:creator>
      <dc:date>2011-07-31T11:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100468#M3481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Instead of deleting it, you could overwrite it each time putting this at the top of your script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.overwriteOutput = True&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 11:38:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100468#M3481</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2011-08-01T11:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100469#M3482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using vb.net, so I dont think using the arcpy syntax would work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a similar command in VB that could be used?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 06:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100469#M3482</guid>
      <dc:creator>KeaganAllan</dc:creator>
      <dc:date>2011-08-04T06:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100470#M3483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, no idea about VB.net&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 11:57:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100470#M3483</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2011-08-04T11:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100471#M3484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bugger...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh well...back to the ol' drawing board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for replying!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 12:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100471#M3484</guid>
      <dc:creator>KeaganAllan</dc:creator>
      <dc:date>2011-08-04T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem - LOCK Files - Scripting</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100472#M3485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to answer my own question, there is a way to allow a geoprocessor to overwrite a file, this can be done by adding&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;GP.OverwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When bringing in the geoprocessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, for me the problem was with the intersect, I was using a Basic Geoprocessor. I am new to this, so I am unsure as to why a Geoprocessing tool can overwrite files, but a Basic Geoprocessing tool cannot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, using a method I found here: &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=993&amp;amp;t=218041"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=993&amp;amp;t=218041&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I created a temp directory in the working directory, then for each time the tool is run, I create a new shp with the iteration as the new name, I then copy the file from the temp directory to the directory it needs to be in and then carry on with the rest of the processes that need to run. Once that is completed I delete the temp files and release all the GP and BGPs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works, its not pretty, but it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is an easier way, please post it here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;K&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 07:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problem-lock-files-scripting/m-p/100472#M3485</guid>
      <dc:creator>KeaganAllan</dc:creator>
      <dc:date>2011-08-05T07:06:23Z</dc:date>
    </item>
  </channel>
</rss>

