Hi,
I ran a few tests to see if a table exists in geodatabase. For some reason the script returns false despite having a proper path and everything. All other features can be accounted for but I don't know why this path is not returning.
import os
import arcpy
Table = # Insert table path
workspace = # Insert workspace path
if os.path.exists(Table):
print ('{} exist'.format(Table))
else:
print ('{} does not exist'.format(Table))
walk = arcpy.da.Walk(workspace, 'Table')
for root, directory, filenames in walk:
for file in filenames:
print (file)
path = os.path.join(root, file)
print (os.path.exists(path))
There is an actual path to the table but for some reason it doesn't seem to appear. The table also has attachments enabled but I don't know if this impacts whether or not the file exists. Here is the print result that I get.
C:\**\OverflowReportAtt does not exist
OverflowReportAtt
False
OverflowReportAtt__ATTACH
False
OverflowReportAtt__ATTACHREL
False
I would greatly appreciate any help on this. If this is a bug, then I will report as such.
Solved! Go to Solution.
Maybe try using arcpy's Exists function for the tables.
Maybe try using arcpy's Exists function for the tables.
Well that worked. I don't know why the file explorer method didn't work but I guess this is a specific file structure that is unique to ArcGIS which probably explains why it didn't recognize it.
Thanks @Anonymous User.