ensuredir for every file