mkdirp with flags