<?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: Check does file exist in folder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57318#M4543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use arcpy...&lt;/P&gt;&lt;P&gt;arcpy.Exists....&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then there is the whole arcpy.ListFeatureClasses, ListRasters, Listwhatever if you need things specific to geodatabases etc.&lt;/P&gt;&lt;P&gt;ie &amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfeatureclasses.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfeatureclasses.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2018 15:43:29 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-04-20T15:43:29Z</dc:date>
    <item>
      <title>Check does file exist in folder</title>
      <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57316#M4541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing a python script which deletes a file if it is present in a particular folder.&lt;/P&gt;&lt;P&gt;I want to be able to check if the file exists first, and if it exists I want to delete the file but if it doesn't exist I want to do nothing.&lt;/P&gt;&lt;P&gt;Anyone any ideas on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 15:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57316#M4541</guid>
      <dc:creator>JohnMcConalogue</dc:creator>
      <dc:date>2018-04-20T15:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Check does file exist in folder</title>
      <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57317#M4542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this article.&amp;nbsp;&lt;A class="link-titled" href="https://www.cyberciti.biz/faq/python-delete-remove-file-if-exists-on-disk/" title="https://www.cyberciti.biz/faq/python-delete-remove-file-if-exists-on-disk/"&gt;https://www.cyberciti.biz/faq/python-delete-remove-file-if-exists-on-disk/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 15:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57317#M4542</guid>
      <dc:creator>KevinDunlop</dc:creator>
      <dc:date>2018-04-20T15:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Check does file exist in folder</title>
      <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57318#M4543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use arcpy...&lt;/P&gt;&lt;P&gt;arcpy.Exists....&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then there is the whole arcpy.ListFeatureClasses, ListRasters, Listwhatever if you need things specific to geodatabases etc.&lt;/P&gt;&lt;P&gt;ie &amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfeatureclasses.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfeatureclasses.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 15:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57318#M4543</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-20T15:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Check does file exist in folder</title>
      <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57319#M4544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/delete.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/delete.htm"&gt;Delete—Help | ArcGIS Desktop&lt;/A&gt; first thing.&amp;nbsp; If the data set or file/folder exists, Delete takes care of business.&amp;nbsp; If it doesn't exist, Delete still succeeds so there is no error to trap.&amp;nbsp; The &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/result.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/result.htm"&gt;Result—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; from Delete will include a warning if the file doesn't exist, but the operation still succeeds.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2018 12:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57319#M4544</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-04-21T12:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Check does file exist in folder</title>
      <link>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57320#M4545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply guys&lt;/P&gt;&lt;P&gt;A modification of Kevin's seemed to do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 10:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-does-file-exist-in-folder/m-p/57320#M4545</guid>
      <dc:creator>JohnMcConalogue</dc:creator>
      <dc:date>2018-04-23T10:14:44Z</dc:date>
    </item>
  </channel>
</rss>

