def receive(self, path, diff, showProgress=True):
        """ Return a context manager for stream that will store a diff. """
        directory = os.path.dirname(path)

        cmd = ["btrfs", "receive", "-e", directory]

        if Store.skipDryRun(logger, self.dryrun)("Command: %s", cmd):
            return None

        if not os.path.exists(directory):
            os.makedirs(directory)

        process = subprocess.Popen(
            cmd,
            stdin=subprocess.PIPE,
            stderr=subprocess.PIPE,
            stdout=DEVNULL,
        )
        _makeNice(process)

        return _Writer(process, process.stdin, path, diff, showProgress)
Return a context manager for stream that will store a diff.