| I tried skip once a long time ago on ULTRIX and it
appeared to do one lseek(2) for each record it had
to skip. I'd guess that it was originally designed
for tapes that support Forward Skip Record, and
done the hard way of reading records where they didn't.
The disk adaptation was probably to lseek one record
at a time. With any luck, iseek does a single lseek.
|
| Or to put it another way, "skip" does n "ibs"-sized reads from the input file.
"iseek" simply does an lseek(fd, ibs * n, SEEK_CUR). The semantic difference
could perhaps be significant if you're reading from a thing where lseek
doesn't make sense.
-- Farrell
[Posted by WWW Notes gateway]
|
| The audit history in dd.c claims that iseek and oseek
were inserted for standards conformance. Apparently they
cause a seek to be done on the (i)nput or (o)utput file
before beginning the read/write phase.
In general seeking is faster than reading (actually
doesn't result in any physical i/o). The iseek would
therefore be faster than skip (still skipping n records
at the beginning of the file; records being sized by
ibs or bs options, defaulting to 512 bytes on disk, but
on tape being a single tape record as formatted on the
tape[don't ask unless you really want to know])
The oseek (glad you pointed this out) now affords us the
opportunity to create a sparse record in the front of a
file. You might ask why you'd want to do that ? Well,
for some of us, sparse file creation is important for
testing. For others, probably only useful if you know
that you need to have blocks and blocks of zeroes in the
front of the file, this would force it to look that way.
Anyone else find a way to use these options ? Hollar.
|