PHP scripts that search through directories and list everything in them are very easy to write and use. You can even sort them by file type and name. Moodle automatically creates directories in the moodledata folder for each course. As far as I know, there's 1 root directory per course and you can't access files outside that directory.
When you say library, I'm assuming you mean some sort of centralised, indexed, searchable collection of files. I think the Moodle core developer team are working on something like that. It would make a lot of sense and make Moodle a lot more efficient and easier to use.