4 ms·
There are a few attempts to make sockets look like a Unix filesystem, but none seem to have caught on, perhaps partly because sockets are pretty portable, while
by _delirium 16y ago
There are a few attempts to make sockets look like a Unix filesystem, but none seem to have caught on, perhaps partly because sockets are pretty portable, while fs-like interfaces, unless one gets widespread support to the extent of being a POSIX-like "assumed to be on all UNIXes", are inevitably tied to a particular OS flavor.
I believe Plan9 was the first to have support for the idea, though, and NetBSD has had it as an option for about 15 years, though I'm not sure if it's currently maintained. Here's an old paper about NetBSD's implementation: http://www.kohala.com/start/portals.ps http://www.kohala.com/start/portals.ps
The existence of netcat also makes it a bit less pressing imo. In the cases where I want a quick shell script that does sockets, I can use netcat as basically a socket library. It's not the everything-is-a-file style of Unixy coding, but it is at least the pipe-simple-utilities style of Unixy coding. And if I want to write a "real app" in some higher-level language, the language can wrap socket-opening at the library level to look like file-opening if it wants to, so it doesn't really have to be done by the OS.
- lisper 16y ago> while fs-like interfaces, unless one gets widespread support to the extent of being a POSIX-like "assumed to be on all UNIXes" FUSE runs on pretty everything, doesn't it?
- sjs 16y agoIt runs on most popular Unix-ish systems.
- SageRaven 16y agoFreeBSD has this (mount_portalfs, whose man page references the paper you link to), though I've only messed with it sparingly out of curiosity. Not sure how stable it is, but I thought it was really cool when I stumbled upon it one day.
- leif 16y agosocat is a little closer to what you really want than netcat: http://www.dest-unreach.org/socat/ http://www.dest-unreach.org/socat/