Skip to contentSkip to conversation

Scsi tape write protect status question

DISCUSSION Mark Hounschell 2 participants 3 messages Jul 14, 2009 – Jul 15, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

Sorry to bother you all with such an easy thing. I can't figure out how the kernel knows I have a write protected tape in a drive that I open via

open("/dev/st0", O_RDWR, cf_flg, 0666)

Using the sgio interface I can only sense a write protect status after attempting to to a write.
How can one know this before doing a write op?

Thanks in advance
Mark

#1 lore raw
Quoted 5 lines · Mark Hounschell

Sorry to bother you all with such an easy thing. I can't figure out how the
kernel knows I have a write protected tape in a drive that I open via

open("/dev/st0", O_RDWR, cf_flg, 0666)

Sorry for the typo

open("/dev/st0", O_RDWR, 0666)

Quoted 12 lines

Using the sgio interface I can only sense a write protect status after attempting to to a write.
How can one know this before doing a write op?

Thanks in advance
Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 5 lines · Mark Hounschell
Quoted 4 lines · Mark Hounschell

Sorry to bother you all with such an easy thing. I can't figure out how the
kernel knows I have a write protected tape in a drive that I open via

Quoted 10 lines
Quoted 1 line

open("/dev/st0", O_RDWR, cf_flg, 0666)

Sorry for the typo

open("/dev/st0", O_RDWR, 0666)

Quoted 4 lines

Using the sgio interface I can only sense a write protect status after attempting to to a write.
How can one know this before doing a write op?

Never mind, it's in the mode-sense data.
Mark