Hi All,
I have a relatively simple script that describes the data source and folder for lyrx files. The script worked fine in ArcMap but I am reformatting it for Pro and can't get the same output as the Arcmap script had. The script works if the lyrx is being sourced from a geodatabase or an arcgis server service. However, if the data is being sourced from an enterprise geodatabase, it gives me a temporary directory, based on whichever user is running the script. Any ideas how I can get the entire SDE path instead of the location of the temporary connection?
Example output-- Layer data source: C:\Users\myuser\AppData\Local\Temp\1\3c5684340c6099e99efde564bfbadb12.sde\sdedatabasename.feasturedataset\sdedatabase.featureclassname
for file in files:
test = arcpy.Describe(file)
if test.layer.dataType == 'FeatureLayer':
arcpy.AddMessage("Working on " + file)
path = '{}\{}'.format(inDir, file) # Adding the inDir path to the front of the file name
desc = arcpy.Describe(path)
print("Layer data source: {}".format(desc.layer.catalogPath))
print ("Folder path to LYRX file: {}".format(desc.path))