pocketzeroes/pipeviewer

Add --skip option to seek in the input

GoogleCodeExporter opened this issue · 1 comments

I am checking block device backups with cmp, and using pv to watch progress.

cmp has a skip option that allows to checking a problem area again, but is hard 
to combine with pv. For example, doing

    dd ibs=1c skip=$SKIP if=$FILE1 |pv |cmp -i $SKIP $FILE2

works, but only with 1-byte blocks, and very slowly. With a `--skip` option, 
things would work much better:

    pv --skip=$SKIP $FILE1 |cmp -i $SKIP $FILE2

pv can skip efficiently with a seek, and know how much data is still left to 
compute an ETA.

cmp also supports a --bytes option:

    dd ibs=1c skip=$SKIP count=$BYTES if=$FILE1 |pv |cmp -i $SKIP --bytes $BYTES $FILE2

Which stops comparing after reading so many bytes. It doesn't really need to be 
supported by pv, since cmp will close stdin when it has read enough. Adjusting 
the size estimate with -s is enough:

    pv --skip=$SKIP -s $BYTES $FILE1 |cmp -i $SKIP --bytes $BYTES $FILE2

Original issue reported on code.google.com by g2p.c...@gmail.com on 31 Jul 2010 at 9:37

At the moment I would be worried about overcomplicating the transfer code, 
since it has to deal with multiple input files.

Original comment by ivarch...@gmail.com on 14 Dec 2010 at 1:55

  • Changed state: WontFix