[comp.sys.sgi] blocking requirements on 1/4" tapes

jim@baroque.Stanford.EDU (James Helman) (12/16/90)

When writing to /dev/tape (QIC-150 1/4" drive), if the total number of
bytes written (before an fclose() or an fflush()) is not a multiple of
512, the fclose() or fflush() returns with EOF, errno is set to
EINVAL, and the last fraction of 512 bytes is not written to the tape.
If you're unlucky enough to be redirecting output to /dev/tape from a
program which isn't careful enough to fflush/fclose(stdout) and check
status, this means silently lost data.

Although the man page for tps doesn't mention it, I assume the base
cause of this is that the drive only supports 512 byte blocks.  

I have two questions:

1) Is there a good reason why the tps driver doesn't pad out the last
block to 512 and write it on fflush() or fclose()?  A padded file is
generally better than lost data.

2) Is there any way for an application to find out that a stream
(whether stdout or from an explicit fopen()) has certain blocking
requirements?

Thanks,

Jim Helman
Department of Applied Physics			Durand 012
Stanford University				FAX: (415) 725-3377
(jim@KAOS.stanford.edu) 			Work: (415) 723-9127