def prep_directory(self, target_dir):
dirname = path.dirname(target_dir)<EOL>if dirname:<EOL><INDENT>dirname = path.join(settings.BUILD_DIR, dirname)<EOL>if not self.fs.exists(dirname):<EOL><INDENT>logger.debug("<STR_LIT>".format(self.fs_name, dirname))<EOL>self.fs.makedirs(dirname)<EOL><DEDENT><DEDENT>
Prepares a new directory to store the file at the provided path, if needed.