On 1 Aug 1999, Marc SCHAEFER wrote:
> Hi,
>
> I have just modified a program which was accessing a tar file (look
> in linux-userfs for more questions :)), using fread() and also
> fseek().
>
The Linux SCSI tape driver does not support lseek() (and I have not seen
it on any other Unix either). The basic reason is that the data on a tape
is addressed as blocks and so lseek() does not make sense.
However, you can do what you are aiming at with ioctl:s. You can move tape
forward and backward using the MTIOCTOP ioctl functions FSR and BSR. If
the drive supports direct block addressing (which is your case), you can
use the MTIOCTOP function MTSEEK to to position the tape and the MTIOCPOS
ioctl to get the current position.
The st driver supports using device-specific block addresses and the
logical block addresses defined in the SCSI standard. The default is
device-specific addresses but I strongly recommend using the logical block
addresses, if possible (you can enable this with 'mt stsetoption
scsi2logical').
Note that the block addresses are counted from the start of the tape.
You can get more information from the file README.st, the st man page, or
by asking me.
Kai
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]