Traverse a directory saving file information to a database