The_Decryptor@aussie.zonetoProgramming@programming.dev•Which protocol or open standard do you like or wish was more popular?English
0·
17 days agoPlan 9 even extended the “everything is a file” philosophy to networking, unlike everybody else that used sockets instead.
They’re “file like” in the sense that they’re exposed as an
fd
, but they’re not exposed via the filesystem at all (Unlike e.g. unix sockets), and the existing API is just mapped over the sockets one (i.e.write()
instead ofsend()
,read()
instead ofrecv()
). There’s also a difference in how you create them, youopen()
a file, butconnect()
a socket, etc.(As an aside, it turns out Bash has its own virtual file-based wrapper around sockets, so you can do things like
cat
a remote port with Bash, something you can do natively in Plan 9)Really it just shows that “everything is a file” didn’t stand up in practice, there’s more stuff that needs special treatment than doesn’t (e.g. Interacting with TTYs also has special APIs). It makes more sense to have a better dedicated API than a generic catch-all one.