Finding tape block size

Doug Gwyn gwyn at smoke.brl.mil
Sat Feb 16 16:34:24 AEST 1991


In article <1991Feb12.224353.6514 at gjetor.geac.COM> adeboer at gjetor.geac.COM (Anthony DeBoer) writes:
>... if there's a way to determine exactly what block size was used when the
>tape was written, or even if this is a major requirement (should I even be
>worrying about it or not?).

Assuming your tape subsystem conforms to long-established UNIX practice,
if the read() system call specifies a read count less than the actual
block size when reading the "raw tape" device (which is the usual one),
you should get an I/O error since data will be lost.  (If you're trying
to read a "tar" or "cpio" archive, and data ever does get silently lost,
you should see archive checksum comparison errors.)  For read counts
in excess of the block size, read() returns the actual amount of data
read, not the requested size.  Therefore the usual practice is to try to
read using an over-generous allocation for the input buffer, which should
not introduce any significant amount of inefficiency.

If you have an oddball device driver or hardware, you may be out of luck.



More information about the Comp.unix.wizards mailing list