use pathname to create recursive directories, to allow chmod of only created directories