4 ms·
to be fair, it's where UTF-8 debuted
by bear8642 4y ago
to be fair, it's where UTF-8 debuted
- enriquto 4y agoand /proc Unfortunately, kids these days seem to be afraid of files. For a hardcore unix fan, curl and wget are useless tools when you can just cat /www/url
- ithkuil 4y agoIt's seems nice on a first glance. But how do you set headers and content type for example?
- oneplane 4y agoYou echo the request into /www/url and cat the response from it
- enriquto 4y agoor even better, to avoid state, the url "file" is executable and you pipe through it: /www/url < request > answer
- theamk 4y agothat already exists, the command is "wget -i - -o -"
- stusmall 4y agoHow does it know where to send it? Does it just assume it should use the contents of the Host header and send the request there or is the "url" in your path the destination? Does it support things like SNI?[1] Can you spoof that? Does it expect clients to parse out the raw output of the HTTP response? I have so many questions. From a quick glance this seems a lot harder to work with than curl for both trivial and non-trivial uses. I tried to find docs on it, but couldn't. If you could link me to some, I'd appreciate it. [1] After posting this I remember like a doofus this is an OS from the 90s. Of course it doesn't. But a similar question could be asked about any other TLS level setting. That's just one I've had to spend more time debugging using curl in the past.
- seiferteric 4y agoTo be fair you'd probably end up with a tool like curl just for setting all the options and headers, but it would just be a wrapper around sending the request to the url file. Just like there are tools for reading and parsing files in /proc.
- deleted 4y ago[deleted]
- pengaru 4y ago/proc predates plan9, plan9 just made it hierarchical https://en.wikipedia.org/wiki/Procfs#History https://en.wikipedia.org/wiki/Procfs#History
- anderspitman 4y ago> kids these days seem to be afraid of files Sad but true. Android and iOS are the worst offenders I've seen. They're apparently trying to completely get rid of the concept of files altogether, which is really unfortunate for anyone wanting to build cool stuff on those platforms. I understand there can be security benefits but at what cost.
- eyelidlessness 4y ago> They're apparently trying to completely get rid of the concept of files altogether I’ve never followed Android very closely but iOS began with no user-facing notion of files and added one many years and major releases later. Granted they’re not Unix everything-is-a-file, as in you can’t execute them or do all sorts of other everything-is-a-file operations with them. But adding mostly-general file functionality is definitely not trying to get rid of the concept.
- saagarjha 4y ago/proc is cute for manual tasks but utterly broke as an API due to inherent races and issues passing context around.
- enriquto 4y agoSo utterly broke that the poor "htop" program cannot work at all... oh wait $ strace htop 2>/tmp/e # wait for htop to load and then press 'q' $ cat /tmp/e | grep ^open | grep /proc | wc -l 49817 htop is essentially "find /proc" with a pretty output. Is htop broken for you?
- saagarjha 4y agoThere’s no need to be snarky, especially when you’re missing the point. htop missing a race on a PID is no big deal. GDB doing so is a critical issue. /proc is nice to have for diagnostics but once again it makes for terrible API.
- smorrow 4y agoAnd yet Plan 9 has a curl/wget equivalent, `hget`.
- enriquto 4y agoIn the ideal world this would be a two-line wrapper that just calls cat on the given url
- fomine3 4y agoUTF-8 worth prize.