Related: Solved: Re: Print files in folder as ArcCatalog sees them - Esri Community
I would like a function that lists non-GIS files in a directory.
Ideally, it'd be kind of the inverse of arcpy.da.Walk, which only lists GIS files "as Catalog sees them" (This is false. Catalog sees things that Walk can't, and vice versa).
Obviously, the best thing would be a function that lists GIS and non-GIS files at once, but I would be more than happy to settle for one that just lists non-GIS files, since I could combine it with the otherwise very useful arcpy.da.Walk()
As it stands now, there isn't a good way to list the contents of a folder that contains GIS and non-gis formats, meaning that your options are to either use arcpy.da.Walk() and miss out on the non-GIS data, or to use os.walk() and suffer through this:
 |
| Results of os.walk() |
When we could have something closer to this:
- CDT_ALL_Trail.mdb
- example1.lyrx
- example1.shp
- Georeferencing guide.docx
- Refresh.lyrx
- gdb\ex1
- gdb\ex2
- gdb\example4
Using os.walk(), I myself have figured out a way to filter out GIS files, but it took a long time to figure out and required me to:
- arcpy.ListFiles
- Filter that list through my list of extensions to ignore

Note: There are 96 extensions here and I know for a fact I'm missing several more that I need.
- Take the filtered list and combine it with the results of:
- arcpy.ListFeatureClasses
- arcpy.ListDatasets:
- For each dataset, I have to set the environment to that dataset, then run List.FeatureClasses, then append that to the main list of files, then reset the environment.
- arcpy.ListTables
- arcpy.ListRasters
- Also needed to differentiate between GDBs and non-gdb folders.
It is also not as efficient as I'm sure it could be.
Please give us a way to tell the contents of a folder containing GIS and non-GIS data that does not require us to wade through all the component files that make up GIS data.
As I said in the second link up above, I really, really never need to see an IXS file.