0

On UNIX OS, for which of the following I/O devices the access is not via a special file of type "character I/O"?

  1. Mouse
  2. Screen
  3. Disk On Key (USB)
  4. Printer
  5. None of the above

This question is from a test on Operation System course.

I chose answer number 5 but my teacher says that the only correct answer is answer number 3. Is there a special case where answer number 3 on USB falls? I would be happy for an edge case so they can accept my appeal please and I will not fail.

Thanks in advance.

John19
  • 1
  • 1
    Assuming "2. Screen" means a tty or tty-like device (like the console, a serial port, an xterm or other terminal emulator, etc), your teacher is correct. The Mouse, Screen, and Printer are all character devices. The USB drive is a block device. – cas Jul 06 '21 at 13:38
  • @cas I read answer 5 as being “None of the above [are not character devices]” (or rather, “None of the above [are accessed not through a character device]”). – Stephen Kitt Jul 06 '21 at 14:06

1 Answers1

2

Yes, there is a special case where USB mass storage devices are accessed using a character device: when they’re accessed using the SCSI generic device. (That link goes to the Linux kernel’s documentation, but this isn’t Linux-specific.)

However that is unusual for USB devices, and you wouldn’t realistically use that to access the contents stored on the USB device. If you need a specific example, you can use sg_dd to access most USB mass storage devices without using the corresponding block device.

Stephen Kitt
  • 434,908