I understand that directory shows up only once, but it still gives some information about the directory hierarchy. If you don't care about directories, you can always filter them out outside of this function.

I don't understand the argument about Last-Modified. What was causing the error?
I think you can just create a new Attrs if the line begins with "file:" or "directory:", and not care about Last-Modified.