elhalhuli

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

Discussion created by elhalhuli on May 29, 2013
Latest reply on May 29, 2013 by rzufelt
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.

Outcomes