PREV UP next The Ftape Installation and Usage Guide - Ioctls


8.8.9: Switching between raw and regular mode

The ioctls MTIOCRDFTSEG and MTIOCWRFTSEG, MTIOCFTFORMAT and MTIOCFTMODE require that the zftape driver has been switched to raw mode previously by issuing this ioctl with the ft_rawmode component set to `1'. Note that the driver remembers its state between close and open calls. This means that an application program using this ioctl should switch back the driver to regular state by issuing this ioctl with the ft_rawmode component of its argument set to `0'. The argument has to be of type struct mtftmode. This ioctl has been newly introduced in ftape-4.03 and obsoletes the use of the `raw access devices' `/dev/rawft*'. See Raw access mode. The definition of the ioctl and its argument can be found in [/usr/src/ftape-4.05/]include/linux/mtio.h Below is a copy for your reference.

struct mtftmode {
        int ft_rawmode:1; /* 1: switch to raw mode, 0: switch to normal mode */
};
#define MTIOCFTMODE     _IOW('m', 12, struct mtftmode) /* raw mode switch */

When using the driver in raw mode it is not possible to use file marks. Data is read from and written to tape as is. Note that the volume table segment that is used to emulate file marks when using the driver with the other devices is treated as an ordinary data segment. Thus reading the first 29 kilobytes from the tape will give you the data of the volume table segment.

The driver does not detect tapes used by the original ftape-2.x.

`Raw mode' could for example be used for writing backup software that is really QIC-113 compatible. ftape-3.04d (and later versions) uses the volume-table in a way which provides only minimal QIC-113 compatibility, QIC organisations home page. There are two additional ioctls which provide read (see MTIOCRDFTSEG and MTIOCWRFTSEG) and write access to arbitrary floppy tape segments, including the header segments.

The file [/usr/src/ftape-4.05/]include/linux/ftape-header-segment.h

of the ftape-4.05 distribution provides some definitions which might be useful for writing a QIC-113 compatible backup program.


ftape logo Use these buttons to jump to the top menu

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