def write_installed_files(self, paths, prefix, dry_run=False):
prefix = os.path.join(prefix, '<STR_LIT>')<EOL>base = os.path.dirname(self.path)<EOL>base_under_prefix = base.startswith(prefix)<EOL>base = os.path.join(base, '<STR_LIT>')<EOL>record_path = self.get_distinfo_file('<STR_LIT>')<EOL>logger.info('<STR_LIT>', record_path)<EOL>if dry_run:<EOL><INDENT>return None<EOL><DEDENT>with CSVWriter(record_path) as writer:<EOL><INDENT>for path in paths:<EOL><INDENT>if os.path.isdir(path) or path.endswith(('<STR_LIT>', '<STR_LIT>')):<EOL><INDENT>hash_value = size = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>size = '<STR_LIT>' % os.path.getsize(path)<EOL>with open(path, '<STR_LIT:rb>') as fp:<EOL><INDENT>hash_value = self.get_hash(fp.read())<EOL><DEDENT><DEDENT>if path.startswith(base) or (base_under_prefix and<EOL>path.startswith(prefix)):<EOL><INDENT>path = os.path.relpath(path, base)<EOL><DEDENT>writer.writerow((path, hash_value, size))<EOL><DEDENT>if record_path.startswith(base):<EOL><INDENT>record_path = os.path.relpath(record_path, base)<EOL><DEDENT>writer.writerow((record_path, '<STR_LIT>', '<STR_LIT>'))<EOL><DEDENT>return record_path<EOL>
Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any
existing ``RECORD`` file is silently overwritten.

prefix is used to determine when to write absolute paths.