<?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: Seeking clarification on arcpy.Exists() and .ags paths in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076170#M61591</link>
    <description>&lt;P&gt;&amp;nbsp;does arcpy.Describe 's&amp;nbsp;&lt;SPAN&gt;dataType return.&amp;nbsp; Exists&amp;nbsp; will work for workspaces or files.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't have anything to check with&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 02:24:32 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-07-07T02:24:32Z</dc:date>
    <item>
      <title>Seeking clarification on arcpy.Exists() and .ags paths</title>
      <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076164#M61590</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I am hoping to gain a better understanding of how &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/exists.htm" target="_blank" rel="noopener"&gt;arcpy.Exists()&lt;/A&gt; interprets an ArcGIS Server (.ags) connection file (currently using ArcGIS Pro 2.8.1)&lt;BR /&gt;&lt;BR /&gt;After some testing, including the .ags file extension within the string variable will return False while excluding it will return True.&lt;BR /&gt;&lt;BR /&gt;Examples:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

test01 = arcpy.Exists("C:\\Path\\To\\Connection\\sample_ags_file.ags")
print(test01)
False

test02 = arcpy.Exists("C:\\Path\\To\\Connection\\sample_ags_file")
print(test02)
True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone enlighten me as to why the .ags extension returns False?&amp;nbsp; Or is it bad practice to use arcpy.Exists() when attempting to verify the existence of .ags files?&amp;nbsp; I appreciate any clarification!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 01:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076164#M61590</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2021-07-07T01:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking clarification on arcpy.Exists() and .ags paths</title>
      <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076170#M61591</link>
      <description>&lt;P&gt;&amp;nbsp;does arcpy.Describe 's&amp;nbsp;&lt;SPAN&gt;dataType return.&amp;nbsp; Exists&amp;nbsp; will work for workspaces or files.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't have anything to check with&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 02:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076170#M61591</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-07T02:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking clarification on arcpy.Exists() and .ags paths</title>
      <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076179#M61593</link>
      <description>&lt;P&gt;or maybe something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os.path
os.path.exists(file_path)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Jul 2021 03:38:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076179#M61593</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-07-07T03:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking clarification on arcpy.Exists() and .ags paths</title>
      <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076182#M61594</link>
      <description>&lt;P&gt;Good suggestion.&lt;BR /&gt;&lt;BR /&gt;For "C:\\Path\\To\\Connection\\sample_ags_file", the dataType is shown as ServerConnection.&lt;BR /&gt;&lt;BR /&gt;For "C:\\Path\\To\\Connection\\sample_ags_file.ags", the script errors out and says the file does not exist.&lt;BR /&gt;&lt;BR /&gt;I'm assuming .ags extensions need to be excluded when using them with arcpy, but I'm unsure why that is the case if true.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 04:01:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076182#M61594</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2021-07-07T04:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking clarification on arcpy.Exists() and .ags paths</title>
      <link>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076184#M61595</link>
      <description>&lt;P&gt;Yep I can confirm it exists with that (and will likely go that route), but I'm more curious about how .ags file extensions and arcpy.Exists() interact, since I'm seeing different results with/without the extension.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 04:10:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/seeking-clarification-on-arcpy-exists-and-ags/m-p/1076184#M61595</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2021-07-07T04:10:57Z</dc:date>
    </item>
  </channel>
</rss>

