Is there a difference between a Serial Port stream and a Named Pipe (FIFO)? Especially in regards to Linux?
My understanding is that both:
- Are full duplex
- Can be read/written by process that are unrelated (as opposed to how regular Pipes work)
The only difference I can think of are:
- Serial Ports have file descriptors to actual hardware (that the hardware is reading/writting to) whereas a Named Pipe is just a 'file' created on the kernal to store a data stream then 2 (or more?) processes can connect to and read/write.
- Any other differences if any?
Also if I have one named pipe that I create in one process P1 (and another of my processes P2 connects to it) - can P1 use that one file descriptor to write and read to this named pipe? And P2 can do the same (both read and write). Or do I need to create 2 named pipes if I want P1 to be able to write and read to P2? The practical use is that P1 will write commands to P2 and also read results of those commands from P2 aswell.