I have been writing an application in C++ that transmits radio messages by writing to a modem connected to the serial port. To do this I need to get a file descriptor using code of the form
fd1=open(“/dev/ttyS0″, O_RDWR | O_NOCTTY | O_NDELAY);
This made me curious about the nature of the items in /dev. To try to get an idea of the contents of these items I tried a
sudo cat /dev/ttyS0
only to get the message
cat: /dev/ttyS0: Input/output error
which didn't help my understanding at all. Are these items actually a file at all or just a kind of link that allows access to the driver functionality?