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().

I wanted to modify the software to also accept /dev/st0 as file,
as long as all fseek()s are done forward.

It did not work, so in the end I have rolled-my-own fseek() implemented
as dummy fread()s. This is satisfactory at this time, but I would
like to understand more. It also supports going backwards, at this
time by closing/reopening the rewinding tape device, and then reading
from 0. I am pleased since this works perfectly.

My question:
   - How is fseek() be implemented when the seeks are forward only
     with a tape drive (st.c) ?  (really: how is read() implemented
     when the file offset has augmented)
   - And when the seeks are all directions ?

I am interested by the current implementation. In theory DAT drives
can be exactly (on a record basis) positionned in all directions. Other
drives might only support going forward or backward a certain number of
blocks. But in any case, the driver could emulate what I have hacked
in my user-land software.  Or, if it doesn't support it, it could
return an error. It *looked* that the seek comportment was not
right, and that no error was returned.

If noone answers, I will try to understand by myself, however, at this
time it's probably better if someone already knowing can help me.

Please Cc: me since I am not sure I receive linux-scsi completely.


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to