Create directories if they don't exist
When a filename is specified in a pattern file, check if the
directory exists and if it doesn't create it.