Example #1
0
    def symlink_to_task(self, task_id):
        """Create symlink of current target file copy to given task_id path"""
        if not self.is_file:
            return

        copy_path = cwd("storage", "binaries", self.sha256)
        symlink = cwd("binary", analysis=task_id)
        try:
            Files.symlink_or_copy(copy_path, symlink)
        except OSError as e:
            log.error(
                "Failed to create symlink in task folder #%s to file '%s'."
                " Error: %s", task_id, copy_path, e)