2

If I run the following rdiff command

rdiff patch basefile patchfile outputfile

everything works as expected, however, if I try to use stdin to provide the base file like this

xz -d -c basefile.xz | rdiff patch - patchfile outputfile

I get the following errors

librsync: ERROR: (rs_file_copy_cb) seek failed: Illegal seek
librsync: ERROR: (rs_job_complete) patch job failed: IO error
librsync: ERROR: IO error

The man page clearly states

In every case where a filename must be specified, - may be used instead to mean either standard input or standard output as appropriate.

Is the man page incorrect, or am I doing something wrong? Is it possible to provide the base file to rdiff using a pipe? Any other way to provide the basefile to rdiff via the xz command without creating a temporary file which isn't an option for what I'm trying to accomplish?

Harry Muscle
  • 2,437
  • 2
  • 13
  • 8
  • It looks like the man page is wrong, it should say "**almost** every case" and mention that`rdiff` needs to seek its "basefile", so that file can't be provided by pipe or process substitution. stdin seems to work ok for providing delta and signature files, seems they don't need to be seeked. I'd suggest submitting a bug report but it looks like you [already have](https://github.com/librsync/librsync/issues/218) – cas Jun 04 '21 at 05:33

0 Answers0