Technical data
SunOS 5.5 Ioctl Requests mtio(7I)
4mm DAT Tape Data is recorded either in Digital Data Storage (DDS) tape format or in Digital Data
Storage, Data Compressed (DDS-DC) tape format. Since it is a variable-lengthtape dev-
ice, the number of bytes in a physical record may vary. The recording formats available
are standard 2Gbyte and compressed format.
Read Operation read(2) reads the next record on the tape. The record size is passed back as the number of
bytes read, provided it is no greater than the number requested. When a tape mark or
end of data is read, a zero byte count is returned; another read will return an error. This
is different from the older BSD behavior where another read will fetch the first record of
the next tape file. If this behavior is required, device names containing the letter b (for
BSD behavior) in the final component should be used.
Two successive reads returning zero byte counts indicate the EOM. No further reading
should be performed past the EOM.
Fixed-length I/O tape devices require the number of bytes read to be a multiple of the
physical record size. For example, 1/4” cartridge tape devices only read multiples of 512
bytes. If the blocking factor is greater than 64512 bytes (minphys limit), fixed-length I/O
tape devices read multiple records.
Most tape devices which support variable-lengthI/O operations may read a range of 1 to
65,535 bytes. If the record size exceeds 65,535 bytes, the driver reads multiple records to
satisfy the request. These multiple records are limited to 65,534 bytes. Newer variable-
length tape drivers may relax the above limitation and allow applications to read record
sizes larger than 65,534. Refer to the specific tape driver man page for details.
Reading past logicalEOT is transparent to the user. A read operation should never hit
physicalEOT.
Read requests that are lesser than a physical tape record are not allowed. Appropriate
error is returned.
Write Operation write(2) writes the next record on the tape. The record has the same lengthas the given
buffer.
Writing is allowed on 1/4” tape at either the beginning of tape or after the last written file
on the tape.
Writing is not so restricted on 1/2”, 4mm, and 8mm cartridge tape. Care should be used
when appendingfiles onto 1/2” reel tape devices, since an extra file mark is appended
after the last file to mark theEOM. This extra file mark must be overwritten to prevent the
creation of a null file. To facilitate write append operations, a space to theEOM ioctl is
provided. Care should be taken when overwriting records; the erase head is just forward
of the write head and any following records will also be erased.
Fixed-length I/O tape devices require the number of bytes written to be a multiple of the
physical record size. For example, 1/4” cartridge tape devices only write multiples of
512 bytes.
modified 30 Aug 1995 7I-217










