119 lines · 1.7 KB · Text
RawDownload
.TH PUMP 1.SH NAMEpump \- copy asynchronously via a large circular buffer.SH SYNOPSIS.B pump[.B -b.I iando] [.B -d.I sleepms] [.B -f.I ofile] [.B -i.I ireadsize] [.B -k.I KB-buf] [.B -o.I owritesize] [.B -s.I start-KB] [.I file\&... ].SH DESCRIPTION.I Pumpcopies.IR files(or standard input if none)to standard outputby using two processes,one reading and one writing,sharing a large circular buffer,thus permitting the reading process toget ahead of the writing process if theoutput device is slow (e.g., an optical disc).This in turn can keep the output device busy.The pipeline.L "dd | dd"can approximate this, but pipe buffering is limited to 64Kbytes, which is fairly modest..PPOptions are:.TF \fL-m.TP.B -bsets the size of.I readand.I writeoperations to.I iandobytes.The default size is 8 kilobytes..TP.B -dcauses the output process to sleep for.I sleepmsmilliseconds initially, giving the readingprocess time to accumulate data in the buffer..TP.B -fwrites.I ofilerather than standard output.TP.B -isets the size of.I readoperations to.I ireadsizebytes..TP.B -kallocates a circular buffer of.I KB-bufkilobytes rather than the default5000 kilobytes..TP.B -osets the size of.I writeoperations to.I owritesizebytes..TP.B -sprevents output until.I start-KBkilobytes have been read..SH EXAMPLESAppend a.IR venti (8)arena to a DVD or BD quickly..PD 0.IP.EXcdfsventi/rdarena arena0 arena.3 |	pump -b 65536 -k 51200 >/mnt/cd/wd/arena.3.EE.PD.\" .SH FILES.SH SOURCE.B /sys/src/cmd/pump.c.SH SEE ALSO.IR cp (1),.IR dd (1),.IR ecp (1),.IR cdfs (4).SH BUGS.I Pumpprocesses spin while waiting for the circular bufferto fill or drain.