def persist_trash_info(self, basename, content, logger):
self.ensure_dir(self.info_dir, <NUM_LIT>)<EOL>index = <NUM_LIT:0><EOL>while True :<EOL><INDENT>if index == <NUM_LIT:0> :<EOL><INDENT>suffix = "<STR_LIT>"<EOL><DEDENT>elif index < <NUM_LIT:100>:<EOL><INDENT>suffix = "<STR_LIT>" % index<EOL><DEDENT>else :<EOL><INDENT>import random<EOL>suffix = "<STR_LIT>" % random.randint(<NUM_LIT:0>, <NUM_LIT>)<EOL><DEDENT>base_id = basename<EOL>trash_id = base_id + suffix<EOL>trash_info_basename = trash_id+"<STR_LIT>"<EOL>dest = os.path.join(self.info_dir, trash_info_basename)<EOL>try :<EOL><INDENT>self.atomic_write(dest, content)<EOL>logger.debug("<STR_LIT>" % dest)<EOL>return dest<EOL><DEDENT>except OSError:<EOL><INDENT>logger.debug("<STR_LIT>" % dest)<EOL><DEDENT>index += <NUM_LIT:1><EOL><DEDENT>raise IOError()<EOL>
Create a .trashinfo file in the $trash/info directory.
returns the created TrashInfoFile.