PREV UP NEXT The Ftape Installation and Usage Guide


8.8.1.6: MTWEOF

C code
struct mtop op = { MTWEOF, COUNT };
result = ioctl(tapefd, MTIOCTOP, &op);

Description

Write COUNT file marks at the current position. For ftape-3.04d (and later versions) this command is illegal -- as is all write access to the tape -- unless the tape is located at either BOT (Begin Of Tape) or EOD (End Of Data, end of area that already is occupied by data).


Notes

The MTWEOF ioctl is interpreted by ftape-3.04d (and later versions) as follows:

A volume table entry is created that covers all of the data from the end of the previous volume or BOT (if the tape is empty) up to the current position. If nothing has been written, then a volume table entry for a zero-size volume is created.

If COUNT is greater than 1 then COUNT - 1 additional zero-size volume table entries are created.


Caveats

Note that MTWEOF is pretty useless when used with mt because the ftape-3.04d (and later versions) driver automatically inserts a file mark when closing the device. Therefore all of the examples below will do nothing but insert empty volumes. Note that each empty volume -- although nothing is recorded -- consumes 29k of tape space.


Limitations

There is a limit of the maximum available number of file marks per cartridge. Each file marks consumes 128 bytes in the volume table segment, the volume table segment has a size of 29k which yields a maximum number of 232 file marks. The volume table overflow extension as proposed by various qic standards (see QIC Organisations Home Page) is not supported by ftape.


Bugs

When using MTWEOF right before closing the driver then ftape-3.04d (and later versions) will not insert a second file mark unless something has been written to the tape after the last MTWEOF. I don't know if this is a bug.


Example

COUNT set to `1', i.e. write a single file mark:

mt -f /dev/nqft0 weof 1

or equivalently (since COUNT has the value `1')

mt -f /dev/nqft0 weof

References
File marks
MTFSF
MTBSF
MTFSFM
see MTBSFM.

ftape logo Use these buttons to jump to the top menu

TOP (previous node) TOP (parent node) TOP (next node) TOP (this node)