609: def run(indata, dir)
610:
611:
612: if @symlink
613: UI.event :symlink, "Skipped delta of symlink #@path"
614: else
615: begin
616: Dir.chdir dir do
617: UI.event :delta, @path
618:
619:
620: if not File.exist? @path
621: UI.event :missing, "Can't delta #@path, file missing"
622: return false
623: end
624:
625:
626: if @length > 0
627: reference = File.read @path
628: delta = StringIO.new(indata.read(@length))
629: outfile = File.open(@path, "wb")
630:
631: SuffixArrayDelta::apply_delta(reference, delta, outfile)
632: end
633:
634:
635: File.utime(Time.new, @mtime, @path)
636: end
637: rescue
638: UI.failure :delta, "#$!"
639: outfile.close if outfile
640: return false
641: end
642: end
643:
644: return true
645: end