News for hackers. Stuff that matters.
Re:The Beauty of Unix Pipelines by DSMan195276 on Thursday June 04, 2020 @08:28PM (#23423706)
I think you're just seeing the abstraction fall apart a bit - for weirder devices, I would say they are "accessible" via a file, but you likely can't interact with it without special tools/syscalls/ioctls. For example, cat'ing your serial connection won't always work, occasionally you'll need to configure the serial device or tty settings first and things can get pretty messy. That's why programs like `minicom` exist.

For networking, I don't think there's a particular reason it doesn't exist, but it's worth noting sockets are a little special and require a bit extra care (Which is why they have special syscalls like `shutdown()` and `send()` and `recv()`). If you did pass a TCP socket to `cat` or other programs (Which you can do! just a bit of fork-exec magic), you'd discover it doesn't always work quite right. And while I don't know the history on why such a feature doesn't exist, with the fact that tools like socat or curl do the job pretty well I don't think it's seen as that necessary.

Re:The Beauty of Unix Pipelines by XorNot on Thursday June 04, 2020 @09:39PM (#23424152)
Theoretically it would work if the devices were exposed as directories, not files (which is basically what /proc actually does for most things).

/dev/ttyS0 should really be /dev/ttyS0/{data, ctr, baud, parity, stopbits, startbits} (probably a bunch I'm forgetting).

Re:The Beauty of Unix Pipelines by AnIdiotOnTheNet on Friday June 05, 2020 @10:56AM (#23429260)
Congratulations, you've re-invented Plan9!