How to "catalogue" / "classify" all files in a project?


Can I use the editor scripting, to “iterate” over all the files in a project, and extract their file type, and some basic meta-data, like the size, and for example the resolution for a texture? And then I would export that to JSON or XML. How would I do that?