Create the directory before writing files there