Don't write files before creating the directory in the first place.