Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

No Maps or Layers returned by arcpy.da.Walk()

$
0
0
I have been trying to implement arcpy.da.Walk() as a replacement for the os.walk when looking for spatial data.
My code is very simple:

with open(output, 'wb') as csvfile:
csvwriter = csv.writer(csvfile)
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace,followlinks = True):
for filename in filenames:
desc = arcpy.Describe(os.path.join(dirpath, filename))
csvwriter.writerow([desc.catalogPath, desc.name, desc.dataType])

The output contains most items (e.g. tables, geodatabases, feature classes) but does not contain .mxd, .lyr and .mpk files.
When I checked the documentation, this function should pick up these files. I have tested it on several paths and still cannot get these items in my output.

Viewing all articles
Browse latest Browse all 2485

Trending Articles